|
1 | | -#name: Auto Release bot |
2 | | -# |
3 | | -#on: |
4 | | -# pull_request: |
5 | | -# types: [ closed ] |
6 | | -# branches: |
7 | | -# - main |
8 | | -# |
9 | | -#jobs: |
10 | | -# release: |
11 | | -# if: github.event.pull_request.merged == true |
12 | | -# runs-on: ubuntu-latest |
13 | | -# permissions: |
14 | | -# contents: write |
15 | | -# |
16 | | -# steps: |
17 | | -# - uses: actions/create-github-app-token@v1 |
18 | | -# id: app-token |
19 | | -# with: |
20 | | -# app-id: ${{ vars.APP_ID }} |
21 | | -# private-key: ${{ secrets.APP_PRIVATE_KEY }} |
22 | | -# |
23 | | -# - uses: actions/checkout@v4 |
24 | | -# with: |
25 | | -# fetch-depth: 0 |
26 | | -# token: ${{ steps.app-token.outputs.token }} |
27 | | -# ref: ${{ github.base_ref }} |
28 | | -# |
29 | | -# - uses: pnpm/action-setup@v4 |
30 | | -# |
31 | | -# - uses: actions/setup-node@v4 |
32 | | -# with: |
33 | | -# node-version: "lts/*" |
34 | | -# cache: "pnpm" |
35 | | -# |
36 | | -# - run: pnpm install --frozen-lockfile |
37 | | -# |
38 | | -# - run: git config --global user.name 'github-actions[bot]' |
39 | | -# - run: git config --global user.email 'github-actions[bot]@users.noreply.github.com' |
40 | | -# |
41 | | -# - name: Push tags |
42 | | -# run: git push origin --tags |
43 | | -# |
44 | | -# - name: Run release-it |
45 | | -# run: | |
46 | | -# git pull origin main |
47 | | -# pnpm exec release-it --ci |
48 | | -# env: |
49 | | -# GITHUB_TOKEN: ${{ steps.app-token.outputs.token }} |
50 | | - |
51 | | - |
52 | 1 | name: Auto Release bot |
53 | 2 |
|
54 | 3 | on: |
55 | 4 | pull_request: |
56 | | - types: [closed] |
| 5 | + types: [ closed ] |
57 | 6 | branches: |
58 | 7 | - main |
59 | 8 |
|
@@ -89,17 +38,18 @@ jobs: |
89 | 38 | - run: git config --global user.name 'github-actions[bot]' |
90 | 39 | - run: git config --global user.email 'github-actions[bot]@users.noreply.github.com' |
91 | 40 |
|
92 | | - - name: Bump version and tag |
93 | | - run: pnpm exec release-it --ci --no-github |
| 41 | + - name: Run release-it |
| 42 | + run: | |
| 43 | + git pull origin main |
| 44 | + pnpm exec release-it --ci |
94 | 45 | env: |
95 | 46 | GITHUB_TOKEN: ${{ steps.app-token.outputs.token }} |
96 | 47 |
|
97 | | - - name: Push commits and tags |
| 48 | + - name: Convert release to draft |
98 | 49 | run: | |
99 | | - git push origin main |
100 | | - git push origin --tags |
101 | | -
|
102 | | - - name: Create GitHub release |
103 | | - run: pnpm exec release-it --ci --only-github |
| 50 | + RELEASE_ID=$(gh release view v$(jq -r .version package.json) --repo $GITHUB_REPOSITORY --json id -q .id) |
| 51 | + gh release edit $RELEASE_ID --draft --repo $GITHUB_REPOSITORY |
104 | 52 | env: |
105 | 53 | GITHUB_TOKEN: ${{ steps.app-token.outputs.token }} |
| 54 | + |
| 55 | + |
0 commit comments