ci: make build-artifacts a re-usable workflow, also include linux musl #99
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 | ||
|
Check failure on line 1 in .github/workflows/release.yml
|
||
| on: | ||
| push: | ||
| tags: | ||
| - "v[0-9]+.[0-9]+.[0-9]+" | ||
| jobs: | ||
| build-artifcats: | ||
| uses: ./.github/workflows/build-artifacts.yml | ||
| verify: | ||
| needs: ['build-artifact'] | ||
| runs-on: ubuntu-latest | ||
| environment: release | ||
| steps: | ||
| - name: Checkout repository | ||
| uses: actions/checkout@v5 | ||
| with: | ||
| fetch-depth: 50 | ||
| - name: Fetch tags | ||
| run: git fetch --tags --force | ||
| - name: Cargo publish dry-run | ||
| env: | ||
| CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }} | ||
| run: | | ||
| cargo publish --dry-run | ||
| cargo-publish: | ||
| needs: ['build-artifact', 'verify'] | ||
| runs-on: ubuntu-latest | ||
| environment: release | ||
| steps: | ||
| - name: Checkout repository | ||
| uses: actions/checkout@v5 | ||
| with: | ||
| fetch-depth: 50 | ||
| - name: Fetch tags | ||
| run: git fetch --tags --force | ||
| - name: Cargo publish | ||
| env: | ||
| CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }} | ||
| run: | | ||
| cargo publish | ||
| create-github-release: | ||
| needs: ['build-artifact', 'verify'] | ||
| runs-on: ubuntu-latest | ||
| environment: release | ||
| permissions: | ||
| contents: write | ||
| env: | ||
| GH_TOKEN: ${{ github.token }} | ||
| steps: | ||
| - name: Checkout .recent-changelog-entry | ||
| uses: actions/checkout@v5 | ||
| with: | ||
| sparse-checkout: .recent-changelog-entry | ||
| sparse-checkout-cone-mode: false | ||
| - name: Download all workflow run artifacts | ||
| uses: actions/download-artifact@v4 | ||
| with: | ||
| path: artifacts | ||
| - name: Create Github release | ||
| working-directory: artifacts | ||
| run: | | ||
| gh release create "$GITHUB_REF_NAME" -F ../.recent-changelog-entry | ||
| ls | xargs -I{} zip -r {}.zip {} | ||
| ls *.zip | xargs gh release upload "$GITHUB_REF_NAME" | ||