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

59 lines
1.5 KiB
YAML
Raw Normal View History

2019-10-13 10:44:26 +08:00
name: Publish
on:
push:
2021-08-03 02:38:00 +08:00
branches:
- master
2021-08-13 11:58:47 +08:00
paths-ignore:
- README.md
- .gitignore
- .github/**
2019-10-13 10:44:26 +08:00
jobs:
publish:
2022-09-24 14:48:30 +08:00
runs-on: ${{ matrix.os }}
strategy:
matrix:
node-version: [16.x]
os: [ubuntu-latest]
2019-10-13 10:44:26 +08:00
steps:
- uses: actions/checkout@v1
2022-09-24 14:48:30 +08:00
- name: Use Node.js ${{ matrix.node_version }}
uses: actions/setup-node@v1
2019-10-13 10:44:26 +08:00
with:
2022-09-24 14:48:30 +08:00
node-version: ${{ matrix.node_version }}
- name: npm install, build, and test
run: |
2023-02-26 02:30:55 +08:00
export NODE_OPTIONS=--openssl-legacy-provider
2022-09-24 14:48:30 +08:00
npm install
npm run test -- --coverage --watchAll=false
2021-08-03 02:38:00 +08:00
2019-10-13 10:44:26 +08:00
- name: Setup GIT
run: |
2020-01-17 05:36:52 +08:00
git reset --hard
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:
2021-08-03 02:38:00 +08:00
GH_EMAIL: ${{secrets.GH_EMAIL}}
2019-10-13 10:44:26 +08:00
- 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
2019-10-13 12:21:46 +08:00
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}}
2021-08-03 02:38:00 +08:00
2019-10-13 10:44:26 +08:00
- name: npm publish
run: |
npm config set //registry.npmjs.org/:_authToken=$NODE_AUTH_TOKEN
npm run trypublish
env:
2021-08-03 02:38:00 +08:00
NODE_AUTH_TOKEN: ${{secrets.NODE_AUTH_TOKEN}}