Thanks to visit codestin.com
Credit goes to Github.com

Skip to content

ci: make build-artifacts a re-usable workflow, also include linux musl #99

ci: make build-artifacts a re-usable workflow, also include linux musl

ci: make build-artifacts a re-usable workflow, also include linux musl #99

Workflow file for this run

name: release

Check failure on line 1 in .github/workflows/release.yml

View workflow run for this annotation

GitHub Actions / .github/workflows/release.yml

Invalid workflow file

(Line: 12, Col: 13): Job 'verify' depends on unknown job 'build-artifact'., (Line: 31, Col: 13): Job 'cargo-publish' depends on unknown job 'build-artifact'., (Line: 31, Col: 31): Job 'cargo-publish' depends on job 'verify' which creates a cycle in the dependency graph., (Line: 50, Col: 13): Job 'create-github-release' depends on unknown job 'build-artifact'., (Line: 50, Col: 31): Job 'create-github-release' depends on job 'verify' which creates a cycle in the dependency graph.
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"