v2.0.18 #17
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
on: | |
release: | |
types: [created] | |
name: Release | |
permissions: | |
contents: write | |
jobs: | |
goreleaser: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v2 | |
with: | |
fetch-depth: 0 | |
- name: Get release | |
id: get_release | |
uses: bruceadams/[email protected] | |
env: | |
GITHUB_TOKEN: ${{ github.token }} | |
- uses: actions/setup-node@v1 | |
with: | |
node-version: 10 | |
- name: Update version in package.json | |
uses: actions/github-script@v6 | |
with: | |
github-token: ${{ secrets.GITHUB_TOKEN }} | |
script: | | |
const fs = require('fs'); | |
const packageJson = JSON.parse(fs.readFileSync('package.json', 'utf8')); | |
packageJson.version = '${{ steps.get_release.outputs.tag_name }}'.replace(/^v/, ''); | |
fs.writeFileSync('package.json', JSON.stringify(packageJson, null, 2)); | |
- run: npm install | |
- uses: JS-DevTools/npm-publish@v1 | |
with: | |
token: ${{ secrets.NPM_TOKEN }} |