|
5 | 5 | types: [closed] |
6 | 6 | branches: |
7 | 7 | - main |
8 | | - workflow_dispatch: |
9 | | - inputs: |
10 | | - base_sha: |
11 | | - description: 'Base commit SHA' |
12 | | - required: false |
13 | | - default: 'a31725d0de490f83ffc3b51c16d46ab98bef6214' |
14 | | - head_sha: |
15 | | - description: 'Head commit SHA' |
16 | | - required: false |
17 | | - default: 'c448992824d6410e08d07e0af3e41e44b2ec746d' |
18 | 8 |
|
19 | 9 | jobs: |
20 | 10 | publish-release: |
21 | | - # Temporarily hardcoded to fix failed release |
| 11 | + # Only run on merged release PRs |
| 12 | + if: github.event.pull_request.merged == true && contains(github.event.pull_request.labels.*.name, 'release') |
22 | 13 | runs-on: ubuntu-latest |
23 | 14 | permissions: |
24 | 15 | contents: write |
|
47 | 38 |
|
48 | 39 | - name: Validate packages before publishing |
49 | 40 | env: |
50 | | - BASE_SHA: a31725d0de490f83ffc3b51c16d46ab98bef6214 |
51 | | - HEAD_SHA: c448992824d6410e08d07e0af3e41e44b2ec746d |
| 41 | + BASE_SHA: ${{ github.event.pull_request.base.sha }} |
| 42 | + HEAD_SHA: ${{ github.event.pull_request.head.sha }} |
52 | 43 | run: | |
53 | 44 | echo "=========================================" |
54 | 45 | echo "Phase 1: Validation (dry-run)" |
|
58 | 49 | - name: Publish packages to crates.io |
59 | 50 | env: |
60 | 51 | CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }} |
61 | | - BASE_SHA: a31725d0de490f83ffc3b51c16d46ab98bef6214 |
62 | | - HEAD_SHA: c448992824d6410e08d07e0af3e41e44b2ec746d |
| 52 | + BASE_SHA: ${{ github.event.pull_request.base.sha }} |
| 53 | + HEAD_SHA: ${{ github.event.pull_request.head.sha }} |
63 | 54 | run: | |
64 | 55 | echo "" |
65 | 56 | echo "=========================================" |
|
70 | 61 | - name: Create GitHub releases |
71 | 62 | env: |
72 | 63 | GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
73 | | - BASE_SHA: a31725d0de490f83ffc3b51c16d46ab98bef6214 |
74 | | - HEAD_SHA: c448992824d6410e08d07e0af3e41e44b2ec746d |
| 64 | + BASE_SHA: ${{ github.event.pull_request.base.sha }} |
| 65 | + HEAD_SHA: ${{ github.event.pull_request.head.sha }} |
75 | 66 | run: | |
76 | 67 | echo "" |
77 | 68 | echo "=========================================" |
|
0 commit comments