Skip to content

Commit f359ef7

Browse files
authored
Merge pull request #59 from SolidOS/npm-publish-latest
Update ci.yml
2 parents 2eb5a14 + f4bf782 commit f359ef7

File tree

1 file changed

+20
-2
lines changed

1 file changed

+20
-2
lines changed

.github/workflows/ci.yml

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ jobs:
3434
- run: npm test
3535
- run: npm run build --if-present
3636
- name: Save build
37-
if: matrix.node-version == '14.x'
37+
if: matrix.node-version == '16.x'
3838
uses: actions/upload-artifact@v2
3939
with:
4040
name: build
@@ -52,7 +52,7 @@ jobs:
5252
name: build
5353
- uses: actions/setup-node@v1
5454
with:
55-
node-version: 14.x
55+
node-version: 16.x
5656
- uses: rlespinasse/[email protected]
5757
- name: Append commit hash to package version
5858
run: 'sed -i -E "s/(\"version\": *\"[^\"]+)/\1-${GITHUB_SHA_SHORT}/" package.json'
@@ -62,3 +62,21 @@ jobs:
6262
with:
6363
token: ${{ secrets.NPM_TOKEN }}
6464
tag: ${{ env.GITHUB_REF_SLUG }}
65+
66+
npm-publish-latest:
67+
needs: build
68+
runs-on: ubuntu-latest
69+
if: github.ref == 'refs/heads/main'
70+
steps:
71+
- uses: actions/download-artifact@v2
72+
with:
73+
name: build
74+
- uses: actions/setup-node@v1
75+
with:
76+
node-version: 16.x
77+
- name: Disable pre- and post-publish actions
78+
run: 'sed -i -E "s/\"((pre|post)publish)/\"ignore:\1/" package.json'
79+
- uses: JS-DevTools/npm-publish@v1
80+
with:
81+
token: ${{ secrets.NPM_TOKEN }}
82+
tag: latest

0 commit comments

Comments
 (0)