-
Notifications
You must be signed in to change notification settings - Fork 7
59 lines (54 loc) · 1.71 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
name: Release/Publish
on:
workflow_call:
secrets:
NPM_TOKEN:
required: true
concurrency: ${{ github.workflow }}-${{ github.ref }}
jobs:
release_or_publish_package:
name: Release & Publish to NPM Registry
runs-on: ubuntu-latest
outputs:
was_published: ${{ steps.changesets.outputs.published }}
steps:
- uses: actions/checkout@v3
with:
submodules: true
persist-credentials: false
- uses: actions/setup-node@v3
with:
cache: 'npm'
cache-dependency-path: '**/package-lock.json'
node-version: '18'
- run: npm ci --prefer-offline
- name: Create a Release PR or Publish to NPM Registry
id: changesets
uses: changesets/action@v1
with:
version: npm run version
publish: npm run release:npm
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
- uses: actions/setup-node@v3
with:
cache: 'npm'
cache-dependency-path: '**/package-lock.json'
node-version: '18'
registry-url: 'https://npm.pkg.github.com'
scope: '@equinor'
- name: Create a Release PR or Publish to Github Registry
uses: changesets/action@v1
with:
version: npm run version
publish: npm run release:github
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
publish_released_docs:
needs: release_or_publish_package
if: needs.release_or_publish_package.outputs.was_published == 'true'
uses: ./.github/workflows/github-pages.yml
with:
version_to_deploy: 'latest'