-
Notifications
You must be signed in to change notification settings - Fork 146
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore(ci): add workflow to publish a single package (#3234)
- Loading branch information
Showing
1 changed file
with
52 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
name: Publish Package | ||
|
||
# This workflow publishes a single package to NPM | ||
|
||
on: | ||
workflow_dispatch: | ||
inputs: | ||
package: | ||
description: 'The package to publish' | ||
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@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1 | ||
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 |