Skip to content

Merge branch 'main' of https://github.com/nativeui-org/primitives #18

Merge branch 'main' of https://github.com/nativeui-org/primitives

Merge branch 'main' of https://github.com/nativeui-org/primitives #18

Workflow file for this run

name: Release (Changesets)
on:
push:
branches: [main]
jobs:
release:
runs-on: ubuntu-latest
permissions:
contents: write
pull-requests: write
id-token: write
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
token: ${{ secrets.CHANGESETS_TOKEN }}
- uses: pnpm/action-setup@v4
with: { version: 10 }
- uses: actions/setup-node@v4
with:
node-version: 20
registry-url: https://registry.npmjs.org/
- run: pnpm install --frozen-lockfile
- name: Build packages
run: pnpm -r --filter @native-ui-org/primitives run build
- name: Configure pnpm for npm
run: |
echo "@native-ui-org:registry=https://registry.npmjs.org/" >> ~/.npmrc
echo "//registry.npmjs.org/:_authToken=${NPM_TOKEN}" >> ~/.npmrc
env:
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
- name: Create Release PR or Publish
id: changesets
uses: changesets/action@v1
with:
version: pnpm changeset version
publish: pnpm changeset publish
createGithubReleases: ${{ fromJSON(steps.changesets.outputs.hasChangesets) == false }}
title: "chore: release primitives"
env:
GITHUB_TOKEN: ${{ secrets.CHANGESETS_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
- name: Create custom GitHub Releases
if: steps.changesets.outputs.published == 'true'
run: |
for package in $(echo '${{ steps.changesets.outputs.publishedPackages }}' | jq -r '.[] | @base64'); do
pkg=$(echo "$package" | base64 --decode | jq -r '.name')
version=$(echo "$package" | base64 --decode | jq -r '.version')
shortName=$(echo "$pkg" | sed 's/@native-ui-org\///')
tag="${shortName}@${version}"
git tag "$tag" || true
git push origin "$tag" || true
gh release create "$tag" \
--title "primitives@${version}" \
--notes "Release primitives version ${version}" \
--repo nativeui-org/primitives
done
env:
GITHUB_TOKEN: ${{ secrets.CHANGESETS_TOKEN }}