Skip to content

Commit 2ac9ac0

Browse files
authored
Merge pull request #345 from MetroStar/manual-publish
Allow Manual Publish
2 parents 8fb1183 + 61671c3 commit 2ac9ac0

File tree

2 files changed

+26
-4
lines changed

2 files changed

+26
-4
lines changed

.github/workflows/publish-package.yaml

Lines changed: 22 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,17 @@ name: Publish Package
33
on:
44
release:
55
types: [published]
6+
workflow_dispatch:
7+
inputs:
8+
package:
9+
description: 'Package to publish'
10+
required: true
11+
type: choice
12+
options:
13+
- comet-uswds
14+
- comet-extras
15+
- comet-data-viz
16+
- comet-cli
617

718
jobs:
819
build-and-publish:
@@ -23,10 +34,19 @@ jobs:
2334
- name: Install dependencies
2435
run: npm ci
2536

37+
- name: Determine Package to Build
38+
id: set-package
39+
run: |
40+
PACKAGE="${{ github.event.inputs.package || 'comet-uswds' }}"
41+
echo "package=$PACKAGE" >> $GITHUB_OUTPUT
42+
echo "build_command=build:$PACKAGE" >> $GITHUB_OUTPUT
43+
2644
- name: Build Package
27-
run: npm run build:comet-uswds
45+
run: npm run ${{ steps.set-package.outputs.build_command }}
2846

2947
- name: Publish Package
30-
run: cd packages/comet-uswds && npm publish --access public --provenance
48+
run: |
49+
cd packages/${{ steps.set-package.outputs.package }}
50+
npm publish --access public --provenance
3151
env:
3252
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

RELEASING.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,10 @@ Note: currently full releases are tied to the main `comet-uswds` package.
2020
1. Create a new release branch in the form of `comet-data-viz-release-[MAJOR.MINOR.PATCH]`
2121
2. Create a PR into main (should only include package.json and package-lock.json)
2222
3. Once approved, merge the PR into main
23-
4. Open a terminal on your local machine and navigate to the root of the project
24-
5. Run a build for the specific package (example below):
23+
4. Navigate to the Actions GitHub page and click Publish Package from the left
24+
5. Click the Run workflow dropdown, select the package to publish, and click Run workflow
25+
6. Verify the Publish Package GitHub Action completes correctly
26+
7. Verify a new release is available in NPM
2527

2628
```
2729
npm run build:comet-data-viz

0 commit comments

Comments
 (0)