mermaid/.github/workflows/release-publish.yml
2019-12-01 00:03:06 +01:00

45 lines
1.1 KiB
YAML

name: Publish release
on:
release:
types: [published]
jobs:
publish:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- uses: fregante/setup-git-token@v1
with:
token: ${{ secrets.GITHUB_TOKEN }}
- name: Setup Node.js
uses: actions/setup-node@v1
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: Prepare release
run: |
echo "Preparing release ${GITHUB_REF:10}"
git checkout -t origin/release/${GITHUB_REF:10}
npm version --no-git-tag-version --allow-same-version ${GITHUB_REF:10}
git add package.json
git commit -m "Bump version ${GITHUB_REF:10}"
git checkout -t origin/master
git merge -m "Release ${GITHUB_REF:10}" --no-ff release/${GITHUB_REF:10}
git push --delete release/${GITHUB_REF:10}
- name: Publish
run: |
npm set //registry.npmjs.org/:_authToken ${{ secrets.GITHUB_TOKEN }}
npm publish