Skip to content

Commit 1949a66

Browse files
chore: add manual-publish.yml Github Action workflow (#553)
1 parent 064abb6 commit 1949a66

File tree

1 file changed

+47
-0
lines changed

1 file changed

+47
-0
lines changed

.github/workflows/manual-publish.yml

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
name: Manual Publish
2+
on:
3+
workflow_dispatch:
4+
inputs:
5+
tag:
6+
required: true
7+
description: NPM distribution tag to use for the backported release (npm publish --tag <tag>)
8+
jobs:
9+
release:
10+
name: Manual Publish
11+
runs-on: ubuntu-latest
12+
steps:
13+
- name: Checkout
14+
uses: actions/checkout@v4
15+
with:
16+
fetch-depth: 0
17+
- name: Setup Nodejs Env
18+
run: echo "NODE_VER=`cat .nvmrc`" >> $GITHUB_ENV
19+
- name: Setup Node.js
20+
uses: actions/setup-node@v2
21+
with:
22+
node-version: ${{ env.NODE_VER }}
23+
- name: Install dependencies
24+
run: npm ci
25+
- name: Validate package-lock.json changes
26+
run: make validate-no-uncommitted-package-lock-changes
27+
- name: Lint
28+
run: npm run lint
29+
- name: Test
30+
run: npm run test
31+
- name: i18n_extract
32+
run: npm run i18n_extract
33+
- name: Coverage
34+
uses: codecov/codecov-action@v2
35+
- name: Build
36+
run: npm run build
37+
# NPM expects to be authenticated for publishing. This step will fail CI if NPM is not authenticated
38+
- name: Check NPM authentication
39+
run: |
40+
echo "//registry.npmjs.org/:_authToken=${{ secrets.SEMANTIC_RELEASE_NPM_TOKEN }}" >> .npmrc
41+
npm whoami
42+
- name: Release
43+
env:
44+
GITHUB_TOKEN: ${{ secrets.SEMANTIC_RELEASE_GITHUB_TOKEN }}
45+
NPM_TOKEN: ${{ secrets.SEMANTIC_RELEASE_NPM_TOKEN }}
46+
# `npm publish` relies on version specified in package.json file
47+
run: npm publish --tag ${{github.event.inputs.tag}} # e.g., old-version

0 commit comments

Comments
 (0)