-
Notifications
You must be signed in to change notification settings - Fork 18
53 lines (46 loc) · 1.39 KB
/
publish.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
name: Publish
on:
workflow_dispatch:
inputs:
semanticVersion:
description: 'Semantic Version [major | minor | patch ]'
required: true
default: 'patch'
jobs:
Publish:
name: Publish
runs-on: ubuntu-latest
if: github.ref == 'refs/heads/main'
steps:
- name: checkout
uses: actions/checkout@v2
with:
token: ${{ secrets.ADMIN_TOKEN }}
ref: 'main'
# pulls all commits (needed for lerna / semantic release to correctly version)
fetch-depth: '0'
- uses: actions/setup-node@v1
with:
node-version: 18
registry-url: https://registry.npmjs.org/
- name: Configure CI Git User
run: |
git config --global user.name 'Justin Smith'
git config --global user.email '[email protected]'
- name: Install Packages
run: yarn install
- name: Build
run: yarn build
- name: Authenticate with Registry
run: |
yarn logout
echo "registry=http://registry.npmjs.org/" >> .npmrc
echo "//registry.npmjs.org/:_authToken=$NPM_TOKEN" >> .npmrc
npm whoami
env:
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
- name: Publish package
run: |
yarn publish:ci ${{ github.event.inputs.semanticVersion }}
env:
GH_TOKEN: ${{ secrets.ADMIN_TOKEN }}