|
59 | 59 | dtags = `--access public ${dtags}`.trim() |
60 | 60 |
|
61 | 61 | core.setOutput('command', `npm publish ./build ${dtags}`) |
62 | | - publish-release: |
63 | | - name: Publish GitHub Release |
64 | | - needs: get-deployment-details |
65 | | - runs-on: ubuntu-latest |
66 | | - steps: |
67 | | - - id: publish |
68 | | - name: Publish GitHub release |
69 | | - uses: actions/github-script@v4 |
70 | | - with: |
71 | | - script: | |
72 | | - const endpoint = 'GET /repos/{owner}/{repo}/releases' |
73 | | - const releases = await github.paginate(endpoint, context.repo) |
74 | | -
|
75 | | - const release = releases.find(({ name }) => { |
76 | | - return name.startsWith(process.env.tag) |
77 | | - }) |
78 | | -
|
79 | | - if (release && release.draft) { |
80 | | - await github.repos.updateRelease({ |
81 | | - ...context.repo, |
82 | | - draft: false, |
83 | | - release_id: release.id, |
84 | | - tag_name: process.env.tag |
85 | | - }) |
86 | | - } |
87 | 62 | publish-package: |
88 | 63 | name: Publish package to GPR & NPM |
89 | | - needs: [get-deployment-details, publish-release] |
| 64 | + needs: get-deployment-details |
90 | 65 | runs-on: ubuntu-latest |
91 | 66 | env: |
92 | 67 | NPM_TOKEN_FLDV: ${{ secrets.NPM_TOKEN_FLDV }} |
@@ -150,6 +125,31 @@ jobs: |
150 | 125 | destination_branch: main |
151 | 126 | source_branch: next |
152 | 127 | source_repo: ${{ github.repository }} |
| 128 | + publish-release: |
| 129 | + name: Publish GitHub Release |
| 130 | + needs: [get-deployment-details, update-production-branch] |
| 131 | + runs-on: ubuntu-latest |
| 132 | + steps: |
| 133 | + - id: publish |
| 134 | + name: Publish GitHub release |
| 135 | + uses: actions/github-script@v4 |
| 136 | + with: |
| 137 | + script: | |
| 138 | + const endpoint = 'GET /repos/{owner}/{repo}/releases' |
| 139 | + const releases = await github.paginate(endpoint, context.repo) |
| 140 | +
|
| 141 | + const release = releases.find(({ name }) => { |
| 142 | + return name.startsWith(process.env.tag) |
| 143 | + }) |
| 144 | +
|
| 145 | + if (release && release.draft) { |
| 146 | + await github.repos.updateRelease({ |
| 147 | + ...context.repo, |
| 148 | + draft: false, |
| 149 | + release_id: release.id, |
| 150 | + tag_name: process.env.tag |
| 151 | + }) |
| 152 | + } |
153 | 153 | close-merged-issues: |
154 | 154 | name: Close issues with status:merged label |
155 | 155 | needs: update-production-branch |
|
0 commit comments