File tree Expand file tree Collapse file tree 2 files changed +61
-0
lines changed Expand file tree Collapse file tree 2 files changed +61
-0
lines changed Original file line number Diff line number Diff line change
1
+ name : prerelease
2
+ on :
3
+ push :
4
+ branches :
5
+ # releases/<tag>/<version>
6
+ - releases/*/*
7
+ jobs :
8
+ prerelease :
9
+ runs-on : ubuntu-latest
10
+ environment : production
11
+ steps :
12
+ - uses : actions/checkout@v2
13
+ - uses : actions/setup-node@v2
14
+ with :
15
+ node-version : ' *'
16
+ cache : ' npm'
17
+ check-latest : true
18
+ registry-url : ' https://registry.npmjs.org'
19
+ - name : Install core dependencies
20
+ run : npm ci --no-audit
21
+ - name : Extract tag and version
22
+ id : extract
23
+ run : |-
24
+ ref=${{ github.ref }}
25
+ branch=${ref:11}
26
+ tag_version=${branch:9}
27
+ tag=${tag_version%/*}
28
+ version=${tag_version##*/}
29
+ echo "::set-output name=tag::${tag}"
30
+ echo "::set-output name=version::${version}"
31
+ - name : Log versions
32
+ run : |-
33
+ echo tag=${{ steps.extract.outputs.tag }}
34
+ echo version=${{ steps.extract.outputs.version }}
35
+ - name : Setup git user
36
+ run : git config --global user.name github-actions
37
+ - name : Setup git email
38
+ run : git config --global user.email github-actions@github.com
39
+ - name : Run npm version
40
+ run : npm version ${{ steps.extract.outputs.version }}-${{ steps.extract.outputs.tag }} --allow-same-version
41
+ - name : Push changes
42
+ run : git push --follow-tags
43
+ - name : Run npm publish
44
+ run : npm publish --tag=${{ steps.extract.outputs.tag }}
45
+ env :
46
+ NODE_AUTH_TOKEN : ${{secrets.NPM_TOKEN}}
Original file line number Diff line number Diff line change 6
6
jobs :
7
7
release-please :
8
8
runs-on : ubuntu-latest
9
+ environment : production
9
10
steps :
10
11
- uses : navikt/github-app-token-generator@a9cd374e271b8aef573b8c16ac46c44fb89b02db
11
12
id : get-token
12
13
with :
13
14
private-key : ${{ secrets.TOKENS_PRIVATE_KEY }}
14
15
app-id : ${{ secrets.TOKENS_APP_ID }}
15
16
- uses : GoogleCloudPlatform/release-please-action@v2
17
+ id : release
16
18
with :
17
19
token : ${{ steps.get-token.outputs.token }}
18
20
release-type : node
19
21
package-name : ' @netlify/plugin-nextjs'
22
+ - uses : actions/checkout@v2
23
+ if : ${{ steps.release.outputs.release_created }}
24
+ - uses : actions/setup-node@v2
25
+ with :
26
+ node-version : ' *'
27
+ cache : ' npm'
28
+ check-latest : true
29
+ registry-url : ' https://registry.npmjs.org'
30
+ if : ${{ steps.release.outputs.release_created }}
31
+ - run : npm publish
32
+ if : ${{ steps.release.outputs.release_created }}
33
+ env :
34
+ NODE_AUTH_TOKEN : ${{secrets.NPM_TOKEN}}
You can’t perform that action at this time.
0 commit comments