|
14 | 14 | - major |
15 | 15 |
|
16 | 16 | jobs: |
17 | | - setup: |
18 | | - runs-on: ubuntu-latest |
19 | | - permissions: |
20 | | - contents: write |
21 | | - steps: |
22 | | - - uses: actions/checkout@v4 |
23 | | - with: |
24 | | - fetch-depth: 0 |
25 | | - |
26 | | - - uses: ./.github/actions/setup |
27 | | - |
28 | 17 | publish: |
29 | | - needs: setup |
30 | 18 | runs-on: ubuntu-latest |
31 | 19 | permissions: |
32 | 20 | contents: write |
33 | 21 | id-token: write |
| 22 | + outputs: |
| 23 | + version: ${{ steps.publish.outputs.version }} |
| 24 | + tag: ${{ steps.publish.outputs.tag }} |
34 | 25 | steps: |
35 | 26 | - uses: actions/checkout@v4 |
36 | 27 | with: |
37 | 28 | fetch-depth: 0 |
38 | 29 |
|
39 | 30 | - uses: ./.github/actions/setup |
40 | 31 |
|
41 | | - - name: Publish |
| 32 | + - name: Publish to NPM |
42 | 33 | id: publish |
43 | | - run: bun run script/publish.ts |
| 34 | + run: bun run scripts/publish.ts |
44 | 35 | env: |
45 | 36 | BUMP: ${{ inputs.bump }} |
46 | 37 | NPM_TOKEN: ${{ secrets.NPM_TOKEN }} |
47 | | - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
48 | | - |
49 | | - outputs: |
50 | | - version: ${{ steps.publish.outputs.version }} |
51 | | - tag: ${{ steps.publish.outputs.tag }} |
52 | 38 |
|
53 | | - commit: |
54 | | - needs: publish |
55 | | - runs-on: ubuntu-latest |
56 | | - permissions: |
57 | | - contents: write |
58 | | - steps: |
59 | | - - name: Commit release version |
| 39 | + - name: Commit version bump |
60 | 40 | id: commit |
61 | 41 | uses: stefanzweifel/git-auto-commit-action@v5 |
62 | 42 | with: |
63 | | - commit_message: "release: v${{ needs.publish.outputs.version }}" |
| 43 | + commit_message: "release: v${{ steps.publish.outputs.version }}" |
64 | 44 | file_pattern: "package.json" |
65 | | - token: ${{ secrets.GH_PAT }} |
| 45 | + |
| 46 | + - name: Save Commit Hash |
| 47 | + id: save_hash |
| 48 | + run: echo "hash=${{ steps.commit.outputs.commit_hash || github.sha }}" >> $GITHUB_OUTPUT |
66 | 49 |
|
67 | 50 | outputs: |
68 | | - commit_hash: ${{ steps.commit.outputs.commit_hash }} |
| 51 | + version: ${{ steps.publish.outputs.version }} |
| 52 | + tag: ${{ steps.publish.outputs.tag }} |
| 53 | + commit_hash: ${{ steps.save_hash.outputs.hash }} |
69 | 54 |
|
70 | 55 | release: |
71 | | - needs: [publish, commit] |
| 56 | + needs: publish |
72 | 57 | runs-on: ubuntu-latest |
73 | 58 | permissions: |
74 | 59 | contents: write |
75 | 60 | steps: |
| 61 | + - uses: actions/checkout@v4 |
| 62 | + |
76 | 63 | - name: Create GitHub release |
77 | 64 | uses: softprops/action-gh-release@v2 |
78 | 65 | with: |
79 | | - tag_name: "v${{ needs.publish.outputs.tag }}" |
80 | | - name: "v${{ needs.publish.outputs.version }}" |
| 66 | + tag_name: ${{ needs.publish.outputs.tag }} |
| 67 | + name: ${{ needs.publish.outputs.tag }} |
81 | 68 | generate_release_notes: true |
82 | | - target_commitish: ${{ needs.commit.outputs.commit_hash }} |
| 69 | + target_commitish: ${{ needs.publish.outputs.commit_hash }} |
0 commit comments