⬆️ Bump husky from 4.2.5 to 9.0.11 #212
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Test Release Publish | |
on: [push] | |
jobs: | |
test: | |
name: Run tests | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v1 | |
- name: Get yarn cache | |
id: yarn-cache | |
run: echo "::set-output name=dir::$(yarn cache dir)" | |
- uses: actions/cache@v1 | |
with: | |
path: ${{ steps.yarn-cache.outputs.dir }} | |
key: ubuntu-latest-node-12.x-yarn-${{ hashFiles('**/yarn.lock') }} | |
restore-keys: | | |
ubuntu-latest-node-12.x-yarn- | |
- uses: actions/setup-node@v1 | |
with: | |
node-version: 12.x | |
registry-url: https://registry.npmjs.org/ | |
- name: Install | |
run: yarn install | |
- name: Test | |
run: yarn test --ci --bail | |
- name: Test TypeScript Type Definitions | |
run: yarn test:typescript | |
- name: Build | |
run: NODE_ENV=production yarn build | |
release_publish: | |
name: Release to Github and publish to NPM | |
runs-on: ubuntu-latest | |
needs: test | |
if: success() && github.ref == 'refs/heads/main' | |
steps: | |
- uses: actions/checkout@v1 | |
- name: Get yarn cache | |
id: yarn-cache | |
run: echo "::set-output name=dir::$(yarn cache dir)" | |
- uses: actions/cache@v1 | |
with: | |
path: ${{ steps.yarn-cache.outputs.dir }} | |
key: ubuntu-latest-node-12.x-yarn-${{ hashFiles('**/yarn.lock') }} | |
restore-keys: | | |
ubuntu-latest-node-12.x-yarn- | |
- uses: actions/setup-node@v1 | |
with: | |
node-version: 12.x | |
registry-url: https://registry.npmjs.org/ | |
- name: Install | |
run: yarn install | |
- name: Build | |
run: NODE_ENV=production yarn build | |
- name: Setup env vars | |
id: ownEnvVars | |
run: | | |
# Set PACKAGE_VERSION | |
PACKAGE_VERSION=$(node -p -e "require('./package.json').version") | |
echo ::set-output name=PACKAGE_VERSION::$PACKAGE_VERSION | |
# Set COMMIT_LOG | |
COMMIT_LOG=`git log $(git describe --tags --abbrev=0)..HEAD --format='%s - %an'` | |
echo ::set-output name=COMMIT_LOG::$COMMIT_LOG | |
- uses: ncipollo/release-action@v1 | |
with: | |
token: ${{ secrets.GITHUB_TOKEN }} | |
tag: ${{ steps.ownEnvVars.outputs.PACKAGE_VERSION }} | |
commit: main | |
body: ${{ steps.ownEnvVars.outputs.COMMIT_LOG }} | |
- name: npm publish | |
run: npm publish | |
env: | |
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} |