Update publish workflows#770
Open
mkernohanbc wants to merge 8 commits into
Open
Conversation
…n-system into ci/publish-workflows
Contributor
There was a problem hiding this comment.
Pull request overview
This PR refactors the package publish GitHub Actions workflows for @bcgov/design-system-react-components and @bcgov/design-tokens by introducing a shared build job that produces an artifact consumed by subsequent registry-specific publish jobs, and removes the temporary test publish workflows introduced in earlier PRs.
Changes:
- Removed the temporary test workflows for publishing tokens/components.
- Added a
buildjob to each publish workflow to install deps, build, and upload an artifact. - Updated publish jobs to download the build artifact and publish with the appropriate dist-tags/registries.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 10 comments.
| File | Description |
|---|---|
.github/workflows/test_publish_react_component_library.yaml |
Removes temporary test workflow used to validate the publish refactor approach. |
.github/workflows/test_publish_design_tokens.yaml |
Removes temporary test workflow used to validate the publish refactor approach. |
.github/workflows/publish_react_component_library.yaml |
Introduces a shared build job and switches publish jobs to consume a downloaded artifact (plus adds Figma Code Connect publish on releases). |
.github/workflows/publish_design_tokens.yaml |
Introduces a shared build job and switches publish jobs to consume a downloaded artifact. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+80
to
85
| - name: Download build artifact | ||
| uses: actions/download-artifact@v4 | ||
| with: | ||
| name: react-components-build | ||
| path: packages/react-components | ||
|
|
Contributor
Author
There was a problem hiding this comment.
This appears totally contradictory with previously-observed job failure: https://github.com/bcgov/design-system/actions/runs/28268823077/job/83761783124
Comment on lines
+104
to
109
| - name: Download build artifact | ||
| uses: actions/download-artifact@v4 | ||
| with: | ||
| name: react-components-build | ||
| path: packages/react-components | ||
|
|
Comment on lines
+131
to
136
| - name: Download build artifact | ||
| uses: actions/download-artifact@v4 | ||
| with: | ||
| name: react-components-build | ||
| path: packages/react-components | ||
|
|
Comment on lines
+155
to
160
| - name: Download build artifact | ||
| uses: actions/download-artifact@v4 | ||
| with: | ||
| node-version: ${{ env.GITHUB_NVMRC_VERSION }} | ||
| name: react-components-build | ||
| path: packages/react-components | ||
|
|
Comment on lines
+76
to
+81
| - name: Download build artifact | ||
| uses: actions/download-artifact@v4 | ||
| with: | ||
| name: design-tokens-build | ||
| path: packages/design-tokens/dist | ||
|
|
Comment on lines
+101
to
+106
| - name: Download build artifact | ||
| uses: actions/download-artifact@v4 | ||
| with: | ||
| node-version: ${{ env.GITHUB_NVMRC_VERSION }} | ||
|
|
||
| - name: Install dependencies | ||
| run: npm install | ||
| working-directory: ./packages/design-tokens | ||
|
|
||
| - name: Install jq | ||
| run: sudo apt-get install -y jq | ||
|
|
||
| - name: Run build script | ||
| run: npm run build | ||
| working-directory: ./packages/design-tokens | ||
|
|
||
| # After dependencies are installed and build is complete, change registry to GitHub Packages | ||
| - name: Rerun Node.js setup for GitHub Packages publishing | ||
| name: design-tokens-build | ||
| path: packages/design-tokens/dist | ||
| - name: Set up Node.js |
Comment on lines
+128
to
133
| - name: Download build artifact | ||
| uses: actions/download-artifact@v4 | ||
| with: | ||
| name: design-tokens-build | ||
| path: packages/design-tokens/dist | ||
|
|
Comment on lines
+153
to
158
| - name: Download build artifact | ||
| uses: actions/download-artifact@v4 | ||
| with: | ||
| node-version: ${{ env.GITHUB_NVMRC_VERSION }} | ||
| name: design-tokens-build | ||
| path: packages/design-tokens/dist | ||
|
|
Comment on lines
21
to
23
| - name: Checkout code | ||
| uses: actions/checkout@v6 | ||
|
|
Comment on lines
29
to
33
| - name: Set up Node.js | ||
| uses: actions/setup-node@v6 | ||
| with: | ||
| node-version: ${{ env.GITHUB_NVMRC_VERSION }} | ||
| registry-url: "https://registry.npmjs.org/" | ||
| node-version: ${{ steps.nvmrc.outputs.version }} | ||
|
|
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR refactors the publish workflows for
@bcgov/design-system-react-componentsand@bcgov/design-tokenswith the changes from #762 and #763. It also removes the test workflows added in #762.This change moves duplicated steps from the four publish jobs into a unified
buildjob, that runs before the publish jobs. Thebuildjob installs dependencies and generates a build artifact, which it uploads via@actions/upload-artifact.The publish jobs retrieve the build artifact via
@actions/download-artifact, and then publish to their respective target registries with the correct dist-tag.