mirror of
https://github.com/mermaid-js/mermaid.git
synced 2025-01-14 06:43:25 +08:00
8af36b742e
Conflicts: dist/mermaid.core.js dist/mermaid.core.js.map dist/mermaid.js dist/mermaid.js.map dist/mermaid.min.js dist/mermaid.min.js.map
38 lines
1.1 KiB
YAML
38 lines
1.1 KiB
YAML
name: Publish release preview package
|
|
|
|
on:
|
|
push:
|
|
branches:
|
|
- 'release/**'
|
|
|
|
jobs:
|
|
publish:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v2
|
|
- name: Setup Node.js
|
|
uses: actions/setup-node@v2
|
|
with:
|
|
node-version: 16.x
|
|
- name: Install Yarn
|
|
run: npm i yarn --global
|
|
|
|
- name: Install Json
|
|
run: npm i json --global
|
|
|
|
- name: Install Packages
|
|
run: yarn install --frozen-lockfile
|
|
|
|
- name: Publish
|
|
run: |
|
|
PREVIEW_VERSION=8
|
|
VERSION=$(echo ${{github.ref}} | tail -c +20)-preview.$PREVIEW_VERSION
|
|
echo $VERSION
|
|
npm version --no-git-tag-version --allow-same-version $VERSION
|
|
npm set //npm.pkg.github.com/:_authToken ${{ secrets.GITHUB_TOKEN }}
|
|
npm set registry https://npm.pkg.github.com/mermaid-js
|
|
json -I -f package.json -e 'this.name="@mermaid-js/mermaid"' # Package name needs to be set to a scoped one because GitHub registry requires this
|
|
json -I -f package.json -e 'this.repository="git://github.com/mermaid-js/mermaid"' # Repo url needs to have a specific format too
|
|
npm publish
|
|
|