mermaid/.github/workflows/release-preview-publish.yml

38 lines
1.1 KiB
YAML
Raw Normal View History

2019-10-16 03:23:22 +02:00
name: Publish release preview package
2019-10-15 22:43:36 +02:00
2019-10-16 21:57:35 +02:00
on:
push:
branches:
- 'release/**'
2019-10-15 22:43:36 +02:00
jobs:
2019-10-16 03:23:22 +02:00
publish:
2019-10-15 22:43:36 +02:00
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
2019-11-30 23:23:09 +01:00
- name: Setup Node.js
uses: actions/setup-node@v3
2019-10-15 22:43:36 +02:00
with:
node-version: 16.x
2019-10-15 22:43:36 +02:00
- name: Install Yarn
run: npm i yarn --global
2019-10-16 03:34:22 +02:00
- name: Install Json
run: npm i json --global
2019-10-15 22:43:36 +02:00
- name: Install Packages
2019-11-30 23:23:09 +01:00
run: yarn install --frozen-lockfile
2019-10-15 22:43:36 +02:00
2019-10-15 23:11:22 +02:00
- name: Publish
run: |
2021-08-05 18:18:18 +02:00
PREVIEW_VERSION=8
2019-10-16 21:57:35 +02:00
VERSION=$(echo ${{github.ref}} | tail -c +20)-preview.$PREVIEW_VERSION
2019-10-15 23:11:22 +02:00
echo $VERSION
2019-10-15 23:28:16 +02:00
npm version --no-git-tag-version --allow-same-version $VERSION
2019-10-16 21:50:06 +02:00
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
2019-10-16 03:23:22 +02:00
npm publish
2019-10-15 23:11:22 +02:00