Skip to content

Add logic to do automated github releases #17

Add logic to do automated github releases

Add logic to do automated github releases #17

Workflow file for this run

name: Version 🔖
on:
push:
# disabled for testing
# branches:
# - main
paths:
- 'package.json'
concurrency: ${{ github.workflow }}-${{ github.ref }}
jobs:
version:
- name: Get version from package.json

Check failure on line 15 in .github/workflows/release.yaml

View workflow run for this annotation

GitHub Actions / .github/workflows/release.yaml

Invalid workflow file

You have an error in your yaml syntax on line 15
id: package_version
run: echo "::set-output name=VERSION::$(node -p "require('./package.json').version")"
- name: Check if tag exists
id: check_tag
run: |
git fetch --tags
if git rev-parse "v${{ steps.package_version.outputs.VERSION }}" >/dev/null 2>&1; then
echo "::set-output name=EXISTS::true"
fi
- name: Create Release
if: steps.check_tag.outputs.EXISTS != 'true'
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: v${{ steps.package_version.outputs.VERSION }}
release_name: Release v${{ steps.package_version.outputs.VERSION }}
draft: false
prerelease: false
- name: Release
runs-on: ubuntu-latest
environment: release
permissions:
contents: read
id-token: write
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: "20.x"
registry-url: "https://registry.npmjs.org"
- run: npm install -g npm@^9.5.0
- run: npm ci
- run: npm publish --provenance --access public
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}