onesignal-rust-api 5.3.0

A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com
Documentation
name: Crates.io Release

on:
  push:
    branches: [main]
  workflow_dispatch:

jobs:
  publish:
    name: Create GitHub Release
    runs-on: ubuntu-latest
    permissions:
      contents: write
      issues: write
      pull-requests: write
    steps:
      - name: Checkout
        uses: actions/checkout@v5
        with:
          fetch-depth: 0
          token: ${{ secrets.GITHUB_TOKEN }}
      - name: Create GitHub Release
        env:
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
        run: |
          npx -p semantic-release \
              -p @semantic-release/changelog \
              -p @semantic-release/git \
              -p @semantic-release/github \
              -p conventional-changelog-conventionalcommits \
              semantic-release
  release:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v5

      - name: Set up Rust
        uses: actions-rs/toolchain@v1
        with:
          toolchain: stable
          override: true
          profile: minimal

      - name: Cache cargo registry
        uses: actions/cache@v3
        with:
          path: ~/.cargo/registry
          key: ${{ runner.os }}-cargo-registry-${{ hashFiles('**/Cargo.lock') }}

      - name: Cache cargo index
        uses: actions/cache@v3
        with:
          path: ~/.cargo/git
          key: ${{ runner.os }}-cargo-git-${{ hashFiles('**/Cargo.lock') }}

      - name: Cache target directory
        uses: actions/cache@v3
        with:
          path: target
          key: ${{ runner.os }}-cargo-target-${{ hashFiles('**/Cargo.lock') }}

      - name: Run tests
        run: cargo test --all-features
        continue-on-error: true

      - name: Build release
        run: cargo build --release

      - name: Publish to crates.io
        uses: katyo/publish-crates@v2
        with:
          registry-token: ${{ secrets.CARGO_REGISTRY_TOKEN }}

      - name: Upload build artifacts
        uses: actions/upload-artifact@v4
        if: always()
        with:
          name: rust-artifacts
          path: target/release/