-
Notifications
You must be signed in to change notification settings - Fork 0
77 lines (72 loc) · 2.07 KB
/
build.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
name: Build 'n Deploy
permissions:
packages: write
on:
push:
branches:
- '*'
tags-ignore:
- '*'
paths-ignore:
- 'package.json'
- 'package-lock.json'
- 'bumpver.toml'
jobs:
build:
name: build, lint, and test
runs-on: ubuntu-latest
steps:
# -- Setup --
- uses: getsentry/action-github-app-token@v2
name: my-app-install token
id: podaac-cicd
with:
app_id: ${{ secrets.CICD_APP_ID }}
private_key: ${{ secrets.CICD_APP_PRIVATE_KEY }}
- uses: actions/checkout@v3
with:
repository: ${{ github.repository }}
token: ${{ steps.podaac-cicd.outputs.token }}
- uses: actions/setup-python@v4
with:
python-version: '3.9'
- name: Install bumpver
run: pip3 install bumpver
- uses: actions/setup-node@v3
with:
node-version: 18
registry-url: 'https://npm.pkg.github.com'
- name: Setup git user
run: |
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
git config user.name "github-actions[bot]"
- name: Install package
run: npm ci
# -- Linting --
- name: Lint
run: npm run lint
# -- Version Bumping --
- name: Bump alpha version
if: github.ref == 'refs/heads/develop'
run: |
TAG=$(bumpver show -e | awk -F= '$1 == "TAG" {print $2};')
if [ $TAG == 'final' ]; then
# Bump patch version first then append tag
bumpver update --patch --tag alpha --tag-num
else
bumpver update --tag alpha --tag-num
fi
- name: Bump rc version
if: startsWith(github.ref, 'refs/heads/release/')
run: bumpver update --patch --tag rc --tag-num
- name: Release version
if: github.ref == 'refs/heads/main'
run: bumpver update --patch --tag final
# -- Publish --
- name: Publish
if: |
startsWith(github.ref, 'refs/heads/release/') ||
github.ref == 'refs/heads/main'
run: npm publish
env:
NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}