-
Notifications
You must be signed in to change notification settings - Fork 0
46 lines (42 loc) · 2.01 KB
/
npm-publish-npmjs.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
name: Publish Package to npmjs
on:
release:
types: [published]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
# Setup .npmrc file to publish to npm
- uses: actions/setup-node@v3
with:
node-version: 18
cache: 'yarn'
registry-url: 'https://registry.npmjs.org'
# Defaults to the user or organization that owns the workflow file
scope: '@thepolicylab-projectportals'
- name: Setup .yarnrc.yml
run: |
yarn config set npmScopes.thepolicylab-projectportals.npmRegistryServer "https://registry.npmjs.org"
yarn config set npmScopes.thepolicylab-projectportals.npmAlwaysAuth true
yarn config set npmScopes.thepolicylab-projectportals.npmAuthToken $NPM_AUTH_TOKEN
env:
NPM_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
- run: yarn install --immutable
- run: yarn test
- name: Update version numbers
run: |
yarn workspace "@thepolicylab-projectportals/gatsby-theme-project-portal" version "${{ github.ref_name }}"
yarn workspace "@thepolicylab-projectportals/project-portal-content-netlify" version "${{ github.ref_name }}"
- name: Pre-release packages
if: ${{ github.event_name == 'release' && github.event.release.prerelease == true }}
run: |
yarn workspace "@thepolicylab-projectportals/gatsby-theme-project-portal" npm publish --tag next --access public
yarn workspace "@thepolicylab-projectportals/project-portal-content-netlify" npm publish --tag next --access public
- name: Release packages
if: ${{ github.event_name == 'release' && github.event.release.prerelease == false }}
run: |
yarn workspace "@thepolicylab-projectportals/gatsby-theme-project-portal" npm publish --access public
yarn workspace "@thepolicylab-projectportals/project-portal-content-netlify" npm publish --access public