Skip to content

v2.0.4

v2.0.4 #7

Workflow file for this run

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 }}