simple-keyboard/.github/workflows/publish.yml

50 lines
1.2 KiB
YAML
Raw Normal View History

2019-10-13 10:44:26 +08:00
name: Publish
on:
push:
branches:
- master
2019-10-13 11:23:48 +08:00
pull_request:
branches:
- master
types:
- closed
2019-10-13 10:44:26 +08:00
jobs:
publish:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- uses: actions/setup-node@v1
with:
node-version: 12
- run: npm install
2019-10-13 11:01:48 +08:00
- run: npm run test -- --coverage --watchAll=false
2019-10-13 10:58:04 +08:00
2019-10-13 10:44:26 +08:00
- name: Setup GIT
run: |
2019-10-13 10:58:04 +08:00
git config --local --list
2019-10-13 10:44:26 +08:00
git checkout master
git config user.email "$GH_EMAIL"
git config user.name "Francisco Hodge"
env:
GH_EMAIL: ${{secrets.GH_EMAIL}}
- name: Bump version
run: |
2019-10-13 11:27:28 +08:00
git reset --hard
2019-10-13 10:44:26 +08:00
npm version patch
2019-10-13 11:23:48 +08:00
npm run build
git add . || true
git commit -m "Build Update" || true
2019-10-13 10:44:26 +08:00
git push "https://$GITHUB_ACTOR:$GITHUB_TOKEN@github.com/$GITHUB_REPOSITORY"
env:
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
- name: npm publish
run: |
npm config set //registry.npmjs.org/:_authToken=$NODE_AUTH_TOKEN
npm run trypublish
env:
NODE_AUTH_TOKEN: ${{secrets.NODE_AUTH_TOKEN}}