-
Notifications
You must be signed in to change notification settings - Fork 3k
45 lines (39 loc) · 1.2 KB
/
publish.yml
File metadata and controls
45 lines (39 loc) · 1.2 KB
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
name: publish
on:
# Run manually using the GitHub UI
workflow_dispatch:
inputs:
version:
description: 'Version to publish'
required: false
default: ''
# ...or whenever a GitHub release gets created
release:
types: [published]
jobs:
publish:
name: Publish to npm
runs-on: ubuntu-latest
permissions:
id-token: write # needed for provenance data generation
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0 # include tags
- name: Install Dependencies
uses: ./.github/actions/install-dependencies
with:
node-version: 20
- name: Prepare packages for publishing
run: yarn prepare-packages
- name: Apply updated version to packages
run: |
# Use the version from the workflow input if it's set, otherwise use the tag name from the release
VERSION=${{ github.event.inputs.version || github.ref_name }}
yarn nx release version $VERSION
- name: Publish packages to npm
run: node ./scripts/publish.js
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
NPM_CONFIG_PROVENANCE: true