v0.61.1 #820
Workflow file for this run
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
| name: ui-kit-ts - default | |
| env: | |
| NODE_VERSION: "24" | |
| PNPM_VERSION: "10" | |
| on: | |
| push: | |
| branches: | |
| - "main" | |
| release: | |
| types: [created] | |
| schedule: | |
| - cron: "0 6 * * 1" # At 06:00 on Monday | |
| workflow_dispatch: # to run from the Actions tab on GitHub | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 #checkout full history so we can get the latest tag | |
| - uses: pnpm/action-setup@v4 | |
| with: | |
| version: "${{ vars.PNPM_VERSION || env.PNPM_VERSION }}" | |
| - uses: actions/setup-node@v4 | |
| with: | |
| node-version: "${{ vars.NODE_VERSION || env.NODE_VERSION }}" | |
| cache: "pnpm" | |
| registry-url: "https://registry.npmjs.org" | |
| scope: "@linked-planet" | |
| # if i run the deployment of the github pages from the github web ui, without a release, then there is no github.event.release... | |
| - name: get latest tag | |
| id: get_latest_tag | |
| run: | | |
| LATEST_TAG=$(git tag --sort=-version:refname | head -n 1) | |
| echo latest_tag=${LATEST_TAG} >> $GITHUB_OUTPUT | |
| - name: Install | |
| run: pnpm install --frozen-lockfile | |
| - name: Build Library | |
| run: pnpm run build:lib | |
| - name: Build Showcase | |
| run: VITE_GH_RELEASE_TAG=${{ steps.get_latest_tag.outputs.latest_tag }} pnpm run build:sc | |
| - name: Deploy Showcase to Github Pages | |
| # run deploy either on release or ... | |
| if: ${{ (github.event_name == 'workflow_dispatch' || github.event_name == 'release') }} | |
| uses: JamesIves/github-pages-deploy-action@v4 | |
| with: | |
| branch: docs | |
| folder: dist-showcase | |
| single-commit: true | |
| publish: | |
| needs: build | |
| if: ${{ github.event_name == 'release' }} | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: pnpm/action-setup@v4 | |
| with: | |
| version: "${{ vars.PNPM_VERSION || env.PNPM_VERSION }}" | |
| - uses: actions/setup-node@v4 | |
| with: | |
| node-version: "${{ vars.NODE_VERSION || env.NODE_VERSION }}" | |
| cache: "pnpm" | |
| registry-url: "https://registry.npmjs.org" | |
| scope: "@linked-planet" | |
| - name: Get release version | |
| id: release | |
| run: | | |
| FULL_VERSION=${{ github.event.release.tag_name }} | |
| SHORT_VERSION="${FULL_VERSION#v}" | |
| if ! echo "$SHORT_VERSION" | grep -Eq '^[0-9]+\.[0-9]+\.[0-9]+([-.][A-Za-z0-9._]+)?([+][A-Za-z0-9._]+)?$'; then | |
| echo "Invalid tag name '$FULL_VERSION' -> computed version '$SHORT_VERSION'. Expected 'v<semver>' or '<semver>'." >&2 | |
| exit 1 | |
| fi | |
| echo short_version=${SHORT_VERSION} >> $GITHUB_OUTPUT | |
| - name: Configure Git user | |
| run: | | |
| git config user.email "[email protected]" | |
| git config user.name "GitHub Actions" | |
| - name: Update release version | |
| run: pnpm version --no-git-tag-version ${{ steps.release.outputs.short_version }} | |
| - name: Install Dependencies | |
| run: pnpm install --frozen-lockfile | |
| - name: Build Release | |
| run: pnpm run build:lib | |
| - name: Publish to npmjs | |
| run: npm publish --access public --no-git-checks # this is necessary because we dont want to commit the version bump | |
| env: | |
| NODE_AUTH_TOKEN: ${{secrets.NPM_PUBLISH_TOKEN}} |