Release #254
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| on: | |
| workflow_run: | |
| workflows: [CI] | |
| types: | |
| - completed | |
| branches: [main] | |
| permissions: | |
| contents: write | |
| pull-requests: write | |
| name: Release | |
| jobs: | |
| release-please: | |
| runs-on: ubuntu-latest | |
| if: ${{ github.event.workflow_run.conclusion == 'success' }} | |
| outputs: | |
| releases_created: ${{ steps.release-please.outputs.releases_created }} | |
| tag_name: ${{ steps.release-please.outputs.tag_name }} | |
| steps: | |
| - uses: googleapis/release-please-action@v4 | |
| id: release-please | |
| with: | |
| release-type: rust | |
| token: ${{ secrets.GH_TOKEN }} | |
| upload-binaries: | |
| strategy: | |
| matrix: | |
| include: | |
| - os: ubuntu-latest | |
| target: x86_64-unknown-linux-musl | |
| artifact_name: git-mob | |
| command: cargo | |
| - os: ubuntu-latest | |
| target: aarch64-unknown-linux-musl | |
| artifact_name: git-mob | |
| command: cross | |
| - os: windows-latest | |
| target: x86_64-pc-windows-msvc | |
| artifact_name: git-mob.exe | |
| command: cargo | |
| - os: windows-latest | |
| target: aarch64-pc-windows-msvc | |
| artifact_name: git-mob.exe | |
| command: cargo | |
| - os: macos-latest | |
| target: x86_64-apple-darwin | |
| artifact_name: git-mob | |
| command: cargo | |
| - os: macos-latest | |
| target: aarch64-apple-darwin | |
| artifact_name: git-mob | |
| command: cargo | |
| runs-on: ${{ matrix.os }} | |
| # https://github.com/googleapis/release-please-action/issues/912 | |
| if: ${{ needs.release-please.outputs.releases_created == true || needs.release-please.outputs.releases_created == 'true' }} | |
| needs: [release-please] | |
| steps: | |
| - name: Checkout sources | |
| uses: actions/checkout@v4 | |
| - name: Install stable toolchain | |
| uses: dtolnay/rust-toolchain@stable | |
| with: | |
| targets: ${{ matrix.target }} | |
| - name: Setup cargo cache | |
| uses: actions/cache@v4 | |
| with: | |
| path: | | |
| ~/.cargo/bin/ | |
| ~/.cargo/registry/index/ | |
| ~/.cargo/registry/cache/ | |
| ~/.cargo/git/db/ | |
| target/ | |
| key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }} | |
| - name: Install cross | |
| if: ${{ matrix.command == 'cross' }} | |
| shell: bash | |
| run: | | |
| curl -L --proto '=https' --tlsv1.2 -sSf https://raw.githubusercontent.com/cargo-bins/cargo-binstall/main/install-from-binstall-release.sh | bash | |
| cargo binstall --no-confirm cross | |
| - name: Run cargo build | |
| run: ${{ matrix.command }} build --release --locked --target ${{ matrix.target }} | |
| - name: Archive binary | |
| uses: thedoctor0/[email protected] | |
| with: | |
| type: tar | |
| directory: target/${{ matrix.target }}/release | |
| path: ${{ matrix.artifact_name }} | |
| filename: git-mob-${{ matrix.target }}.tar.gz | |
| - name: Upload archived binary to release | |
| uses: svenstaro/upload-release-action@v2 | |
| with: | |
| repo_token: ${{ secrets.GH_TOKEN }} | |
| file: target/${{ matrix.target }}/release/git-mob-${{ matrix.target }}.tar.gz | |
| tag: ${{ needs.release-please.outputs.tag_name }} | |
| publish-cargo: | |
| runs-on: ubuntu-latest | |
| # https://github.com/googleapis/release-please-action/issues/912 | |
| if: ${{ needs.release-please.outputs.releases_created == true || needs.release-please.outputs.releases_created == 'true' }} | |
| needs: [release-please] | |
| steps: | |
| - name: Checkout sources | |
| uses: actions/checkout@v4 | |
| - name: Install stable toolchain | |
| uses: dtolnay/rust-toolchain@stable | |
| - name: Setup cargo cache | |
| uses: actions/cache@v4 | |
| with: | |
| path: | | |
| ~/.cargo/bin/ | |
| ~/.cargo/registry/index/ | |
| ~/.cargo/registry/cache/ | |
| ~/.cargo/git/db/ | |
| target/ | |
| key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }} | |
| - name: Run cargo publish | |
| run: cargo publish --no-verify --locked | |
| env: | |
| CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }} |