This repository has been archived by the owner on Oct 30, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
67 lines (53 loc) · 1.95 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
66
67
name: Release
on:
workflow_dispatch:
push:
branches:
- production
- vue3
- alpha
- beta
jobs:
release:
concurrency: ${{ github.workflow }}-${{ github.ref }}
runs-on: ubuntu-latest
steps:
- name: Check out branch
uses: actions/checkout@v3
- name: Use Node.js
uses: actions/setup-node@v1
with:
node-version: '18.x'
- name: parse branch from ref
id: branch
run: echo ::set-output name=BRANCH::${GITHUB_REF/refs\/heads\//}
# Will prevent the rest of the steps from running on fail
- name: Check if user is a dialpad member
uses: octokit/[email protected]
with:
route: GET /orgs/dialpad/members/${{ github.actor }}
env:
GITHUB_TOKEN: ${{ secrets.DIALTONE_CI_TOKEN }}
- name: Install dependencies
run: npm ci
- name: Set npm token
run: npm config set //registry.npmjs.org/:_authToken=${{ secrets.NPM_AUTH_TOKEN }}
# note that npm run build is executed before publishing via prepublishOnly
- name: Deploy production
if: ${{ github.ref == 'refs/heads/production' }}
run: npm publish
- name: Deploy prerelease
if: ${{ github.ref != 'refs/heads/production' }}
run: npm publish --tag ${{ steps.branch.outputs.BRANCH }}
- name: Github Release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: npx semantic-release --extends ./release-ci.config.cjs
- name: Set registry to github packages
run: npm config set @dialpad:registry https://npm.pkg.github.com
- name: Set github auth token
run: npm config set //npm.pkg.github.com/:_authToken=${{ secrets.GITHUB_TOKEN }}
# note that npm run build is executed before publishing via prepublishOnly
- name: Deploy production to github packages
if: ${{ github.ref == 'refs/heads/production' }}
run: npm publish