Skip to content

chore: replace hirosystems (#1815) #236

chore: replace hirosystems (#1815)

chore: replace hirosystems (#1815) #236

Workflow file for this run

name: publish
on:
push:
branches:
- main
tags-ignore:
- "**"
paths-ignore:
- "**.md"
workflow_dispatch:
permissions:
id-token: write # Required for OIDC
contents: read
jobs:
pre-run:
uses: ./.github/workflows/pre-run.yml
secrets: inherit
publish:
runs-on: ubuntu-latest
needs: pre-run
if: "needs.pre-run.outputs.is-not-fork == 'true' && (github.event_name == 'workflow_dispatch' || contains(github.event.head_commit.message, 'chore: version packages'))"
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: actions/setup-node@v4
with:
node-version: 24
cache: npm
- run: npm ci
- run: npm run build
- run: git config --local user.email '[email protected]'
- run: git config --local user.name 'GitHub Action'
- name: Publish
run: |
npx lerna publish from-package --no-verify-access --yes
RELEASE=$(cat lerna.json | jq -r '.version')
git tag -a v$RELEASE -m v$RELEASE
git push origin v$RELEASE
publish-beta:
runs-on: ubuntu-latest
needs: pre-run
if: "needs.pre-run.outputs.is-not-fork == 'true' && !contains(github.event.head_commit.message, 'chore: version packages')"
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
# pulls all tags (needed for lerna to correctly version)
- run: git fetch --depth=1 origin +refs/tags/*:refs/tags/*
- uses: actions/setup-node@v4
with:
node-version: 24
cache: npm
- run: npm ci
- run: git config --local user.email '[email protected]'
- run: git config --local user.name 'GitHub Action'
- name: Version & Publish
run: |
LATEST=$(git describe --tags --abbrev=0)
npx lerna version $LATEST --force-publish --no-changelog --no-push --no-git-tag-version --yes
git commit -a -m 'DONT PUSH: fast-forward to latest npm release' --allow-empty --no-verify
npx lerna version --force-publish --no-changelog --conventional-commits --conventional-prerelease --preid beta --no-push --no-git-tag-version --yes
git commit -a -m 'DONT PUSH: version beta release' --allow-empty --no-verify
RELEASE=$(cat lerna.json | jq -r '.version')
npx lerna publish from-package --no-verify-access --pre-dist-tag beta --yes
git reset HEAD~2 --hard
git tag v$RELEASE
git push origin v$RELEASE