mermaid/.github/workflows/release-preview-publish.yml
dependabot[bot] 27b6845b78
Bump actions/setup-node from 1 to 2.2.0
Bumps [actions/setup-node](https://github.com/actions/setup-node) from 1 to 2.2.0.
- [Release notes](https://github.com/actions/setup-node/releases)
- [Commits](https://github.com/actions/setup-node/compare/v1...v2.2.0)

---
updated-dependencies:
- dependency-name: actions/setup-node
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2021-06-30 20:08:14 +00:00

38 lines
1.2 KiB
YAML

name: Publish release preview package
on:
push:
branches:
- 'release/**'
jobs:
publish:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2.3.4
- name: Setup Node.js
uses: actions/setup-node@v2.2.0
with:
node-version: 10.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=$(git rev-list --count --first-parent HEAD)
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