forked from jpillora/xhook
-
Notifications
You must be signed in to change notification settings - Fork 0
55 lines (46 loc) · 1.24 KB
/
release.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
name: release
on:
push:
tags:
- "v*"
jobs:
Release:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
ref: main
fetch-depth: 0
- uses: actions/setup-node@v3
with:
node-version: "14"
registry-url: "https://registry.npmjs.org"
- name: reset gh-pages to main
run: |
git checkout gh-pages
git reset --hard main
- name: replace package.json version
run: |
tag=${{github.ref_name}}
version=${tag:1}
sed -i "s/0.0.0-git-tag/$version/" package.json
- name: install dependencies
run: npm ci
env:
PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD: "1"
- name: npm build
run: |
npm run build
- name: publish to npm
run: npm publish
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
- name: Push to gh-pages
run: |
# gh-pages branch should contain dist files
sed -i '/dist\//d' .gitignore
git config user.name github-actions
git config user.email [email protected]
git add .
git commit -m "release ${{github.ref_name}}"
git push -f