mirror of
https://github.com/alexgo-io/stacks.js.git
synced 2026-01-12 17:52:41 +08:00
49 lines
1.2 KiB
YAML
49 lines
1.2 KiB
YAML
name: publish
|
|
|
|
on:
|
|
push:
|
|
branches:
|
|
- master
|
|
tags-ignore:
|
|
- "**"
|
|
paths-ignore:
|
|
- "**.md"
|
|
|
|
workflow_dispatch:
|
|
|
|
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@v3
|
|
with:
|
|
fetch-depth: 0
|
|
- uses: actions/setup-node@v3
|
|
with:
|
|
node-version: 16
|
|
cache: npm
|
|
|
|
- run: npm ci
|
|
- run: npm run bootstrap
|
|
- run: npm run build
|
|
|
|
- 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: 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
|