-
Notifications
You must be signed in to change notification settings - Fork 24
51 lines (51 loc) · 2.09 KB
/
release-github.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
name: Release to GitHub
on:
workflow_dispatch:
push:
branches:
- 'next'
- 'next-major'
- 'one-repository'
env:
HUSKY: 0
jobs:
release:
name: Release
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
with:
fetch-depth: 0
repo-token: ${{ secrets.SEMANTIC_RELEASE_BOT_PAT }}
persist-credentials: false
- name: Setup Node.js
uses: actions/setup-node@v2
with:
node-version: 'lts/*'
- name: Set up NPM token
env:
NPM_TOKEN: ${{ secrets.SEMANTIC_RELEASE_NPM_TOKEN }} # <-- allow npm publish for each workspace
run: 'echo "//registry.npmjs.org/:_authToken=${NPM_TOKEN}" > .npmrc'
- name: Install dependencies
run: npm ci
- name: Build Release Distribution
run: npm run dist
- name: Set explicit npm dist-tag default
if: github.ref_name == 'main'
run: echo "NPM_DIST_TAG=latest" >> $GITHUB_ENV
- name: Override npm dist-tag for non-main releases
if: github.ref_name != 'main'
run: echo "NPM_DIST_TAG=${{ github.ref_name }}" >> $GITHUB_ENV
- name: Get release channel
run: echo "RELEASE_CHANNEL=$(node ./src/js/version.mjs channel $NPM_DIST_TAG)" >> $GITHUB_ENV
- name: Release mono-artifact to GitHub
env:
GITHUB_TOKEN: ${{ secrets.SEMANTIC_RELEASE_BOT_PAT }} # <-- Allows semantic-release-bot to push changes to protected branches
npm_config_tag: ${{ env.NPM_DIST_TAG }} # <-- For main, this is `latest.` Otherwise, `next`, `next-major`, etc. See ./.releaserc for release branch config.
run: npx semantic-release
- name: Release Firebolt SDKs to NPM
env:
NPM_TOKEN: ${{ secrets.SEMANTIC_RELEASE_NPM_TOKEN }} # <-- Allows semantic-release to publish to npm without 2 factor auth.
npm_config_tag: ${{ env.NPM_DIST_TAG }} # <-- For main, this is `latest.` Otherwise, `next`, `next-major`, etc. See ./.releaserc for release branch config.
run: npm publish --dry-run --tag $RELEASE_CHANNEL --workspaces