Skip to content

chore: add repo url to package.json files #20

chore: add repo url to package.json files

chore: add repo url to package.json files #20

Workflow file for this run

name: release
on:
push:
tags:
- "v[0-9]+.[0-9]+.[0-9]+"
permissions:
contents: write
pages: write
id-token: write
jobs:
release:
runs-on: ubuntu-24.04
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: '22'
registry-url: 'https://registry.npmjs.org'
- name: Set version from tag in all packages
run: |
TAG_VERSION="${GITHUB_REF#refs/tags/v}"
for pkg in packages/*; do
if [ -f "$pkg/package.json" ]; then
npm version --no-git-tag-version --workspace="$pkg" "$TAG_VERSION"
fi
done
- name: Install dependencies
run: npm ci
- name: Build packages
run: npm run build
- name: Run tests
run: npm test
- name: Publish all packages
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
run: |
for pkg in packages/*; do
if [ -f "$pkg/package.json" ]; then
cd "$pkg"
npm publish --access public --provenance
cd -
fi
done
- name: Add package.json changes to git
run: |
TAG_VERSION="${GITHUB_REF#refs/tags/v}"
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"
git add packages/*/package.json
git commit -m "chore: set version to $TAG_VERSION"
git tag -f "v$TAG_VERSION"
git push origin HEAD:refs/heads/main --follow-tags
git push origin -f "v$TAG_VERSION"
storybook:
needs: release
runs-on: ubuntu-24.04
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: '22'
- name: Install dependencies
run: npm ci
- name: Build packages
run: npm run build
- name: Build Storybook
run: npm run build-storybook -w packages/ui
- name: Upload Pages artifact
uses: actions/upload-pages-artifact@v3
with:
path: packages/ui/storybook-static
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4