2019-11-30 23:23:09 +01:00
|
|
|
name: Publish release
|
|
|
|
|
|
|
|
on:
|
|
|
|
release:
|
|
|
|
types: [published]
|
|
|
|
|
|
|
|
jobs:
|
|
|
|
publish:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
2022-03-07 19:18:05 +01:00
|
|
|
- uses: actions/checkout@v3
|
2020-10-20 05:31:33 +02:00
|
|
|
- uses: fregante/setup-git-user@v1
|
2019-11-30 23:23:09 +01:00
|
|
|
|
|
|
|
- name: Setup Node.js
|
2022-02-28 08:17:30 +01:00
|
|
|
uses: actions/setup-node@v3
|
2019-11-30 23:23:09 +01:00
|
|
|
with:
|
2021-07-29 12:06:11 +02:00
|
|
|
node-version: 16.x
|
2019-11-30 23:23:09 +01:00
|
|
|
- name: Install Yarn
|
|
|
|
run: npm i yarn --global
|
|
|
|
|
|
|
|
- name: Install Json
|
|
|
|
run: npm i json --global
|
|
|
|
|
2019-12-01 00:21:12 +01:00
|
|
|
- name: Install Packages
|
|
|
|
run: yarn install --frozen-lockfile
|
2019-11-30 23:23:09 +01:00
|
|
|
|
|
|
|
- name: Prepare release
|
|
|
|
run: |
|
2019-12-01 00:39:09 +01:00
|
|
|
VERSION=${GITHUB_REF:10}
|
|
|
|
echo "Preparing release $VERSION"
|
|
|
|
git checkout -t origin/release/$VERSION
|
|
|
|
npm version --no-git-tag-version --allow-same-version $VERSION
|
2019-11-30 23:48:02 +01:00
|
|
|
git add package.json
|
2019-12-01 00:39:09 +01:00
|
|
|
git commit -m "Bump version $VERSION"
|
2019-12-01 00:02:32 +01:00
|
|
|
git checkout -t origin/master
|
2019-12-01 00:39:09 +01:00
|
|
|
git merge -m "Release $VERSION" --no-ff release/$VERSION
|
|
|
|
git push --no-verify
|
2019-11-30 23:23:09 +01:00
|
|
|
|
|
|
|
- name: Publish
|
|
|
|
run: |
|
2019-12-01 00:39:09 +01:00
|
|
|
npm set //registry.npmjs.org/:_authToken $NPM_TOKEN
|
2019-11-30 23:23:09 +01:00
|
|
|
npm publish
|
2019-12-01 00:39:09 +01:00
|
|
|
env:
|
|
|
|
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
|