mirror of
https://github.com/alexgo-io/stacks.js.git
synced 2026-01-12 17:52:41 +08:00
58 lines
1.8 KiB
YAML
58 lines
1.8 KiB
YAML
name: publish-beta
|
|
|
|
on:
|
|
push:
|
|
branches:
|
|
- master
|
|
tags-ignore:
|
|
- "**"
|
|
paths-ignore:
|
|
- "**.md"
|
|
|
|
workflow_dispatch:
|
|
|
|
jobs:
|
|
pre-run:
|
|
uses: ./.github/workflows/pre-run.yml
|
|
secrets: inherit
|
|
|
|
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@v3
|
|
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@v3
|
|
with:
|
|
node-version: 16
|
|
cache: npm
|
|
|
|
- run: npm ci
|
|
- run: npm run bootstrap
|
|
|
|
- run: git config --local user.email 'action@github.com'
|
|
- run: git config --local user.name 'GitHub Action'
|
|
|
|
- run: echo "//registry.npmjs.org/:_authToken=$NPM_TOKEN" > ~/.npmrc
|
|
env:
|
|
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
|
|
|
|
- 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
|
|
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
|
|
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
|