Updates the publish workflow to support new packages and packages that only have 1 published version. Previously the workflow would fail if trying to publish a package that does not exist in the NPM registry, or for packages that only have a single published version.
Separated git config, get package name, version bump, and publish commands into separate steps
Run version bump step only if not publishing a new package
Version bump checks if output of npm [package name] versions is a string or array to support packages that only have 1 version publisehd
Add conditional to changelog step so it only runs on merges to main branch
Add slack message if workflows fails
Rename version_bump workflow input to version_type
Add new package as an option under version_type input
Testing Packages
components-v0.3.6-alpha.0
components-v0.3.6-alpha.1
components-v0.3.6-alpha.2
components-v0.3.6-alpha.3
components-v0.3.6-alpha.4
components-v0.3.6-alpha.5
components-v0.3.6-alpha.6
test-v0.0.2-alpha.0
test-v0.0.2-alpha.2
Screenshots/Video
Testing
Tested on GHA and with test packages on NPM
PR Checklist
Code reviewer validation:
General
[x] PR is linked to ticket(s)
[x] PR has changelog label applied if it's to be included in the changelog
[x] Acceptance criteria:
All satisfied or
Documented reason for not being performed or
Split to separate ticket and ticket is linked by relevant AC(s)
[x] Above PR sections adequately filled out
[x] If any breaking changes, in accordance with the pre-1.0.0 versioning guidelines: a CU ticket has been created for the VA Mobile App detailing necessary adjustments with the package version that will be published by this ticket
Code
[x] Tests are included if appropriate (or split to separate ticket)
Ticket #47
Description of Change
Updates the publish workflow to support new packages and packages that only have 1 published version. Previously the workflow would fail if trying to publish a package that does not exist in the NPM registry, or for packages that only have a single published version.
npm [package name] versions
is a string or array to support packages that only have 1 version publisehdmain
branchversion_bump
workflow input toversion_type
new package
as an option underversion_type
inputTesting Packages
Screenshots/Video
Testing
Tested on GHA and with test packages on NPM
PR Checklist
Code reviewer validation:
changelog
label applied if it's to be included in the changelogPublish
If changes warrant a new version per the versioning guidelines and the PR is approved and ready to merge:
main
into branchmain