Skip to content

Showcase - Add a frameless example for the AppSideNav #1107

Showcase - Add a frameless example for the AppSideNav

Showcase - Add a frameless example for the AppSideNav #1107

name: Release Candidate
on:
workflow_call:
secrets:
NPM_TOKEN:
required: true
pull_request:
types:
- opened
- synchronize
- reopened
- labeled
env:
NODE_VERSION: '22.x'
jobs:
release-candidate:
name: Release Candidate
runs-on: ubuntu-latest
if: contains(github.event.pull_request.labels.*.name, 'release-candidate')
steps:
- name: Checkout Repo
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
# This makes Actions fetch all Git history so that Changesets can generate changelogs with the correct commits
fetch-depth: 0
- name: Install PNPM
uses: pnpm/action-setup@a7487c7e89a18df4991f7f222e4898a00d66ddda # v4.1.0
with:
run_install: false
- name: Setup Node.js
uses: actions/setup-node@cdca7365b2dadb8aad0a33bc7601856ffabcc48e # v4.3.0
with:
node-version: ${{ env.NODE_VERSION }}
cache: pnpm
- name: Install Dependencies
run: pnpm install
- name: Build Components
run: pnpm build
working-directory: packages/components
- name: Version RC Packages
id: version
run: pnpm version-candidate-packages
env:
# Token setup in hashibot-hds' account
GITHUB_TOKEN: ${{ secrets.PAT_TOKEN }}
- name: Publish RC Packages
id: changesets
uses: changesets/action@06245a4e0a36c064a573d4150030f5ec548e4fcc # v1.4.10
with:
publish: pnpm release-candidate-packages
createGithubReleases: false
env:
# Token setup in hashibot-hds' account
GITHUB_TOKEN: ${{ secrets.PAT_TOKEN }}
# Token setup in hashibot-hds' account
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
- name: Compute new packages info
id: packagesData
if: success() && steps.changesets.outputs.published == 'true'
# We're using the special GH Actions syntax to add step outputs (ref: https://docs.github.com/en/actions/reference/workflow-commands-for-github-actions#setting-an-output-parameter)
# for count: use jq to determine the length of the array
# for packageList: use jq reduce to build up a string of markdown (ref: https://stedolan.github.io/jq/manual/#Reduce)
run: |
echo "::set-output name=count::$(echo ${{toJson(steps.changesets.outputs.publishedPackages)}} | jq '. | length')"
echo "::set-output name=packageList::$(echo ${{toJson(steps.changesets.outputs.publishedPackages)}} | jq 'reduce .[] as $item (""; . + "#### \($item.name)@\($item.version)\n```\nyarn up -C \($item.name)@rc\n```\n")')"
- name: Comment
uses: marocchino/sticky-pull-request-comment@52423e01640425a022ef5fd42c6fb5f633a02728 # v2.9.1
if: success() && steps.changesets.outputs.published == 'true'
with:
header: 'rc-release'
message: |
### :package: RC Packages Published
Latest commit: ${{ github.event.pull_request.head.sha }}
<details><summary>Published ${{ steps.packagesData.outputs.count }} packages</summary>
${{ fromJSON(steps.packagesData.outputs.packageList) }}
</details>