-
Notifications
You must be signed in to change notification settings - Fork 154
53 lines (48 loc) · 1.54 KB
/
publish-package.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 Package
# This workflow publishes a single package to NPM
on:
workflow_dispatch:
inputs:
package:
description: 'The package to publish'
type: choice
required: true
options:
- packages/batch
- packages/commons
- packages/idempotency
- packages/jmespath
- packages/logger
- packages/metrics
- packages/tracer
- packages/parameters
- packages/parser
permissions:
contents: read
jobs:
run-unit-tests:
uses: ./.github/workflows/reusable-run-linting-check-and-unit-tests.yml
publish-npm:
needs: run-unit-tests
permissions:
id-token: write
environment: Release
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
ref: ${{ github.sha }}
- name: Setup NodeJS
uses: actions/setup-node@0a44ba7841725637a19e28fa30b79a866c81b0a6 # v4.0.4
with:
node-version: "20"
cache: "npm"
- name: Setup auth tokens
run: |
npm set "//registry.npmjs.org/:_authToken=${{ secrets.NPM_TOKEN }}"
- name: Setup dependencies
uses: aws-powertools/actions/.github/actions/cached-node-modules@d406bac5563f1d8c793519a3eedfe620f6a14872
- name: Publish to npm
run: |
NPM_CONFIG_PROVENANCE=true npx lerna publish from-package --force-publish ${{ github.event.input.package }} --git-head ${{ github.sha }} --yes