-
Notifications
You must be signed in to change notification settings - Fork 2.1k
65 lines (48 loc) · 1.66 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
56
57
58
59
60
61
62
63
64
65
name: release
on:
push:
branches:
- 'master'
- '*-release'
permissions:
contents: read
jobs:
check_tag:
runs-on: ubuntu-latest
continue-on-error: true
steps:
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
- name: Get git tags (https://github.com/actions/checkout/issues/206)
run: git fetch --tags -f
- name: Get version from git tag
run: git describe --exact-match HEAD | grep '^v'
release:
runs-on: ubuntu-latest
needs: check_tag
if: ${{ github.repository_owner == 'visgl' && needs.check_tag.result == 'success' }}
env:
ADMIN_TOKEN: ${{ secrets.ADMIN_TOKEN }}
NPM_ACCESS_TOKEN: ${{ secrets.NPM_ACCESS_TOKEN }}
steps:
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
- name: Get git tags (https://github.com/actions/checkout/issues/206)
run: git fetch --tags -f
- name: Use Node.js
uses: actions/setup-node@8f152de45cc393bb48ce5d89d36b731f54556e65 # v4.0.0
with:
node-version: '18.x'
- name: Create GitHub release entry
run: |
body=$(node scripts/github-release.js) &&
curl \
-X POST \
-H "Accept: application/vnd.github.v3+json" \
https://api.github.com/repos/visgl/deck.gl/releases \
-d "${body}" \
-H "Authorization: token ${ADMIN_TOKEN}"
- name: Login to NPM
run: npm config set "//registry.npmjs.org/:_authToken=${NPM_ACCESS_TOKEN}"
- name: Install dependencies
run: yarn
- name: Publish to NPM
run: npx ocular-publish from-git