Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(ci): add workflow to publish a single package #3234

Merged
merged 2 commits into from
Oct 22, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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