|
1 | | -name: Release |
| 1 | +name: Release Crate |
2 | 2 |
|
3 | 3 | on: |
4 | 4 | workflow_dispatch: |
5 | 5 | inputs: |
6 | 6 | level: |
7 | 7 | description: "Release level (patch, minor, major)" |
8 | 8 | required: true |
| 9 | + default: patch |
9 | 10 | type: choice |
10 | 11 | options: |
11 | 12 | - patch |
|
14 | 15 |
|
15 | 16 | jobs: |
16 | 17 | release: |
17 | | - name: Release Crate |
| 18 | + name: Cargo Release |
18 | 19 | runs-on: ubuntu-latest |
19 | 20 | permissions: |
20 | | - contents: write |
| 21 | + contents: write # for pushing tags/commits |
21 | 22 | steps: |
22 | | - - name: Checkout branch |
| 23 | + - name: Checkout code |
23 | 24 | uses: actions/checkout@v3 |
24 | 25 | with: |
25 | 26 | token: ${{ secrets.GH_PAT }} |
26 | | - fetch-depth: 0 # required for git-cliff |
| 27 | + fetch-depth: 0 # required for tagging and changelog |
27 | 28 |
|
28 | | - - name: Configure Git |
| 29 | + - name: Setup Git identity |
29 | 30 | run: | |
30 | 31 | git config --global user.name "github-actions[bot]" |
31 | 32 | git config --global user.email "github-actions[bot]@users.noreply.github.com" |
32 | 33 |
|
33 | | - - name: Install dependencies |
34 | | - run: | |
35 | | - cargo install cargo-release |
36 | | - cargo install git-cliff |
37 | | -
|
38 | | - - name: Generate Changelog |
39 | | - run: | |
40 | | - git cliff -o CHANGELOG.md |
| 34 | + - name: Install cargo-release |
| 35 | + run: cargo install cargo-release |
41 | 36 |
|
42 | | - - name: Commit Changelog |
43 | | - run: | |
44 | | - git add CHANGELOG.md |
45 | | - git commit -m "chore(changelog): update CHANGELOG.md for release" || echo "No changes to commit" |
46 | | - git push origin HEAD |
47 | | -
|
48 | | - - name: Perform Release |
49 | | - run: | |
50 | | - LEVEL="${{ github.event.inputs.level}}" |
51 | | - cargo release $LEVEL --execute --no-confirm |
| 37 | + - name: Run cargo-release |
52 | 38 | env: |
53 | | - CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN}} |
| 39 | + CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }} |
| 40 | + run: | |
| 41 | + cargo release ${{ github.event.inputs.level }} --execute --no-confirm |
0 commit comments