-
Notifications
You must be signed in to change notification settings - Fork 26
136 lines (129 loc) · 3.88 KB
/
merge.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
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
name: Merge to main
on:
push:
branches:
- main
release:
types: [created]
env:
GIT_USER: 'GitHub Actions'
GIT_EMAIL: 'github-actions[bot]@users.noreply.github.com'
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
jobs:
build:
runs-on: ${{ matrix.os }}
if: ${{ !contains(github.event.head_commit.message, '[skip ci]') }}
strategy:
matrix:
os: [windows-latest, macos-latest, ubuntu-latest]
node-version: [16, 18, 20]
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-version }}
- name: Install Python setup tools
run: pip install setuptools
- name: Set git credentials
run: |
git config --global user.email ${{ env.GIT_USER }}
git config --global user.name ${{ env.GIT_EMAIL }}
- name: Install dependencies
run: yarn
- name: Create initial release
run: yarn release
- name: Build binaries
run: yarn build
- name: Run tests
run: yarn test
- name: Report coverage
run: yarn codecov
- name: Upload js bundle
uses: actions/upload-artifact@v2
with:
name: js-bundle
path: dist
- name: Upload binary artifact
uses: actions/upload-artifact@v2
with:
name: binary-artifact
path: build/stage
deploy:
needs: build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
persist-credentials: false
- name: Pull latest
run: git pull origin main
- name: Install Vuepress
run: yarn add vuepress@next -D
- name: Build documentation
run: yarn docs:build
- name: Create CNAME Record
run: echo "symbology.dev" > build/docs/CNAME
- name: Deploy to GitHub Pages
uses: JamesIves/[email protected]
with:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GIT_CONFIG_NAME: ${{ env.GIT_USER }}
GIT_CONFIG_EMAIL: ${{ env.GIT_EMAIL }}
BRANCH: gh-pages
FOLDER: build/docs
CLEAN: true
release:
needs: build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: TriPSs/conventional-changelog-action@v3
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
git-user-name: ${{ env.GIT_USER }}
git-user-email: ${{ env.GIT_EMAIL }}
tag-prefix: 'v'
release-count: '0'
skip-on-empty: false
upload-binaries:
needs: release
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Download binary artifacts
uses: actions/download-artifact@v2
with:
name: binary-artifact
path: build/stage
- name: Upload binary artifacts to release
# only one folder will be present in build/stage, which is named the new version number
# extract this name and set it as the release name, then upload artifact binaries to it
run: |
set -x
assets=()
for asset in ./build/stage/**/*; do
assets+=("$asset")
done
RELEASE_VERSION=$(echo $(ls build/stage| head -1))
gh release create -t "v$RELEASE_VERSION" "$RELEASE_VERSION" "${assets[@]}"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
publish-npm:
needs: release
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Pull latest
run: git pull origin main
- name: Download js bundle
uses: actions/download-artifact@v2
with:
name: js-bundle
path: dist
- uses: actions/setup-node@v1
with:
node-version: 20
registry-url: https://registry.npmjs.org/
- run: npm publish
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}