Skip to content

Commit

Permalink
chore(ci): add workflow to publish a single package (#3234)
Browse files Browse the repository at this point in the history
  • Loading branch information
am29d authored Oct 22, 2024
1 parent e308143 commit 8a85ca2
Showing 1 changed file with 52 additions and 0 deletions.
52 changes: 52 additions & 0 deletions .github/workflows/publish-package.yml
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

0 comments on commit 8a85ca2

Please sign in to comment.