Merge pull request #517 from Metaswitch/copilot/fix-clippy-warnings #3
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
| name: Release | |
| on: | |
| push: | |
| branches: | |
| - main | |
| permissions: | |
| contents: write | |
| jobs: | |
| get-next-version: | |
| uses: semantic-release-action/next-release-version/.github/workflows/next-release-version.yml@0cdefe1224944c23645e5131f7a5189672c0df92 # v4 | |
| build-artifacts: | |
| name: Build ${{ matrix.name }} artifacts | |
| needs: get-next-version | |
| if: needs.get-next-version.outputs.new-release-published == 'true' | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| include: | |
| - name: Linux | |
| label: linux | |
| os: ubuntu-24.04 | |
| artifact_glob: floki-*.tar.gz | |
| rpm: true | |
| - name: macOS | |
| label: macos | |
| os: macos-latest | |
| artifact_glob: floki-*.zip | |
| rpm: false | |
| uses: ./.github/workflows/build-artifacts.yml | |
| with: | |
| runner: ${{ matrix.os }} | |
| toolchain: stable | |
| artifact_glob: ${{ matrix.artifact_glob }} | |
| artifact_name: dist-${{ matrix.label }} | |
| upload_artifact: true | |
| run_tests: false | |
| rpm: ${{ matrix.rpm }} | |
| release_version: ${{ needs.get-next-version.outputs.new-release-version }} | |
| fetch_depth: '0' | |
| release: | |
| name: Release | |
| runs-on: ubuntu-latest | |
| needs: | |
| - get-next-version | |
| - build-artifacts | |
| if: needs.get-next-version.outputs.new-release-published == 'true' | |
| permissions: | |
| contents: write | |
| issues: write | |
| pull-requests: write | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5 | |
| with: | |
| fetch-depth: 0 | |
| - name: Setup Rust | |
| uses: dtolnay/rust-toolchain@master | |
| with: | |
| toolchain: stable | |
| - name: Rust Cache | |
| uses: Swatinem/rust-cache@f13886b937689c021905a6b90929199931d60db1 # v2.8.1 | |
| - name: Install semantic-release-cargo | |
| run: cargo install --locked semantic-release-cargo | |
| - name: Setup Node.js | |
| uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4 | |
| with: | |
| node-version: "node" | |
| - name: Install dependencies | |
| run: npm ci | |
| - name: Download build artifacts | |
| uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4 | |
| with: | |
| pattern: dist-* | |
| merge-multiple: true | |
| path: dist | |
| - name: Generate checksums | |
| run: | | |
| cd dist | |
| for file in *; do | |
| if [ "$file" = "SHA256SUMS.txt" ]; then | |
| continue | |
| fi | |
| shasum -a 256 "$file" | |
| done > SHA256SUMS.txt | |
| - name: Release | |
| run: npx semantic-release | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| CARGO_REGISTRY_TOKEN: ${{ secrets.PUBLISH_SECRET }} |