Release v4.1.13 #356
Workflow file for this run
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: Publish | |
on: | |
release: | |
types: | |
- published | |
jobs: | |
publish: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
with: | |
ref: v4 | |
token: ${{ secrets.ADMIN_GITHUB_TOKEN }} | |
- name: Get yarn cache directory path | |
id: yarn-cache-dir-path | |
run: echo "::set-output name=dir::$(yarn cache dir)" | |
- uses: actions/cache@v1 | |
id: yarn-cache | |
with: | |
path: ${{ steps.yarn-cache-dir-path.outputs.dir }} | |
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }} | |
restore-keys: | | |
${{ runner.os }}-yarn- | |
- name: Use Node.js | |
uses: actions/setup-node@v1 | |
with: | |
node-version: '16' | |
registry-url: 'https://registry.npmjs.org' | |
- name: Install dependencies | |
run: yarn install | |
- name: Build | |
run: yarn build | |
- name: Lint | |
run: yarn lint | |
- name: Test | |
run: yarn test | |
- name: Get the version | |
id: vars | |
run: echo ::set-output name=tag::$(echo ${GITHUB_REF#"refs/tags/"}) | |
- name: Bump version | |
run: npm version ${{ steps.vars.outputs.tag }} --no-git-tag-version | |
- name: Commit files | |
run: | | |
git config --local user.email "action@github.com" | |
git config --local user.name "GitHub Action" | |
git commit -m "Bump to ${{ steps.vars.outputs.tag }}" -a | |
git tag -f ${{ steps.vars.outputs.tag }} | |
- name: Push changes | |
uses: ad-m/github-push-action@master | |
with: | |
github_token: ${{ secrets.ADMIN_GITHUB_TOKEN }} | |
branch: v4 | |
force: true | |
tags: true | |
- name: Publish | |
run: npm publish | |
env: | |
NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}} |