Skip to content

release

release #316

Workflow file for this run

name: release
on:
workflow_run:
workflows:
- ci
branches:
- master
types:
- completed
jobs:
release:
# double check :)
if: github.ref == 'refs/heads/master'
runs-on: ubuntu-latest
steps:
- name: Git Checkout
uses: actions/checkout@v3
- name: Use Node.js
uses: actions/setup-node@v3
with:
node-version-file: ".nvmrc"
registry-url: "https://registry.npmjs.org"
- name: Check if package.json version has been updated
id: package-version
uses: EndBug/version-check@v1
with:
file-url: https://unpkg.com/@goparrot/eslint-config@latest/package.json
static-checking: localIsNew
- name: Create and push git tag, publish version to NPM and create github release
if: steps.package-version.outputs.changed == 'true'
run: |
echo "Version change found in commit ${{ steps.package-version.outputs.commit }}! New version: ${{ steps.package-version.outputs.version }} (${{ steps.package-version.outputs.type }})"
git tag -f v${{ steps.package-version.outputs.version }} ${{ steps.package-version.outputs.commit }}
git push origin v${{ steps.package-version.outputs.version }}
npm install --progress=false --loglevel=warn --ignore-scripts
npm run publish
npm run github-release
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_PUBLISH_TOKEN }}
CONVENTIONAL_GITHUB_RELEASER_TOKEN: ${{ secrets.GH_RELEASE_TOKEN }}