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

48 lines
1.2 KiB
YAML
Raw Normal View History

2019-11-30 23:23:09 +01:00
name: Publish release
on:
release:
types: [published]
jobs:
publish:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: fregante/setup-git-user@v2
2019-11-30 23:23:09 +01:00
2023-02-16 12:37:03 +01:00
- uses: pnpm/action-setup@v2
# uses version from "packageManager" field in package.json
- name: Setup Node.js
uses: actions/setup-node@v4
2022-09-04 21:30:47 +02:00
with:
2023-02-16 12:37:03 +01:00
cache: pnpm
node-version-file: '.node-version'
2019-11-30 23:23:09 +01:00
2022-09-04 21:30:47 +02:00
- name: Install Packages
2023-02-16 12:37:03 +01:00
run: |
pnpm install --frozen-lockfile
npm i json --global
env:
CYPRESS_CACHE_FOLDER: .cache/Cypress
2019-11-30 23:23:09 +01:00
2022-09-04 21:30:47 +02:00
- name: Prepare release
run: |
VERSION=${GITHUB_REF:10}
echo "Preparing release $VERSION"
git checkout -t origin/release/$VERSION
npm version --no-git-tag-version --allow-same-version $VERSION
git add package.json
2023-02-16 12:39:02 +01:00
git commit -nm "Bump version $VERSION"
2022-09-04 21:30:47 +02:00
git checkout -t origin/master
git merge -m "Release $VERSION" --no-ff release/$VERSION
git push --no-verify
2019-11-30 23:23:09 +01:00
2022-09-04 21:30:47 +02:00
- name: Publish
run: |
npm set //registry.npmjs.org/:_authToken $NPM_TOKEN
npm publish
env:
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}