ci: further split ci jobs #53
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-plz | |
| permissions: | |
| pull-requests: write | |
| contents: write | |
| on: | |
| push: | |
| branches: | |
| - main | |
| jobs: | |
| release-plz-release: | |
| name: Release-plz release | |
| runs-on: ubuntu-latest | |
| concurrency: | |
| group: release-plz-release | |
| cancel-in-progress: false | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd # ratchet:actions/checkout@v5 | |
| with: | |
| fetch-depth: 0 | |
| persist-credentials: false | |
| - uses: ./.github/actions/setup-rust | |
| - name: Run release-plz release | |
| uses: release-plz/action@1efcf74dfcd6e500990dad806e286899ae384064 # ratchet:release-plz/[email protected] | |
| with: | |
| command: release | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.RELEASE_PLZ_TOKEN }} | |
| CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }} | |
| release-plz-pr: | |
| name: Release-plz PR | |
| runs-on: ubuntu-latest | |
| concurrency: | |
| group: release-plz-${{ github.ref }} | |
| cancel-in-progress: false | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd # ratchet:actions/checkout@v5 | |
| with: | |
| fetch-depth: 0 | |
| token: ${{ secrets.RELEASE_PLZ_TOKEN }} | |
| - uses: ./.github/actions/setup-rust | |
| - name: Run release-plz release-pr | |
| id: release-plz | |
| uses: release-plz/action@1efcf74dfcd6e500990dad806e286899ae384064 # ratchet:release-plz/[email protected] | |
| with: | |
| command: release-pr | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.RELEASE_PLZ_TOKEN }} | |
| CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }} | |
| - name: Install git-cliff | |
| if: steps.release-plz.outputs.prs_created == 'true' | |
| uses: taiki-e/install-action@b4b80945859e8ef89a9732a0f46499a443b196fe # ratchet:taiki-e/install-action@v2 | |
| with: | |
| tool: git-cliff | |
| - name: Generate changelogs with git-cliff | |
| if: steps.release-plz.outputs.prs_created == 'true' | |
| run: | | |
| # Checkout the PR branch | |
| git fetch origin ${{ fromJson(steps.release-plz.outputs.pr).head_branch }} | |
| git checkout ${{ fromJson(steps.release-plz.outputs.pr).head_branch }} | |
| # Generate changelog for each crate using its specific config | |
| git cliff --config crates/sickle/cliff.toml \ | |
| --include-path "crates/sickle/**" \ | |
| --output crates/sickle/CHANGELOG.md | |
| git cliff --config crates/santa-data/cliff.toml \ | |
| --include-path "crates/santa-data/**" \ | |
| --output crates/santa-data/CHANGELOG.md | |
| git cliff --config crates/santa-cli/cliff.toml \ | |
| --include-path "crates/santa-cli/**" \ | |
| --output crates/santa-cli/CHANGELOG.md | |
| - name: Commit changelog updates | |
| if: steps.release-plz.outputs.prs_created == 'true' | |
| run: | | |
| git config user.name "github-actions[bot]" | |
| git config user.email "github-actions[bot]@users.noreply.github.com" | |
| # Check if there are changes to commit | |
| if git diff --quiet crates/*/CHANGELOG.md; then | |
| echo "No changelog changes to commit" | |
| else | |
| git add crates/*/CHANGELOG.md | |
| git commit -m "chore: update changelogs with git-cliff" | |
| git push origin ${{ fromJson(steps.release-plz.outputs.pr).head_branch }} | |
| fi |