-
Notifications
You must be signed in to change notification settings - Fork 1
65 lines (48 loc) · 1.7 KB
/
publish.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
56
57
58
59
60
61
62
63
64
65
name: publish
on:
push:
tags: [ "*-v[0-9]+.[0-9]+.[0-9]+" ]
jobs:
publish:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: "20"
cache: npm
registry-url: "https://registry.npmjs.org"
- name: Configure git user
run: |
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
git config user.name "github-actions[bot]"
- name: Resolve workspace
run: echo "WORKSPACE=packages/$(echo ${{ github.ref_name }} | rev | cut -d- -f2- | rev)" >> ${GITHUB_ENV}
- run: npm ci
- name: Build packages
run: |
[ $WORKSPACE == packages/roqueform ] || npm run build --workspace=packages/roqueform
npm run build --workspace=${WORKSPACE}
- run: npm test --workspace=${WORKSPACE}
- run: npm run test:definitions --if-present --workspace=${WORKSPACE}
- run: npm run docs
- run: npm publish --workspace=${WORKSPACE} --access public
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
- name: Publish docs
run: |
set -x
mv ./docs /tmp/docs
git fetch origin ghpages:ghpages
git checkout ghpages
git rm -rf .
git clean -fxd
cp -R /tmp/docs/. .
git add .
! git diff --staged --quiet --exit-code || exit 0
git commit -m "Updated docs (${GITHUB_SHA::7})"
git push origin ghpages
- name: Create release draft
run: gh release create ${{ github.ref_name }} --generate-notes --draft
env:
GH_TOKEN: ${{ github.token }}