Skip to content

0.0.6

0.0.6 #10

Workflow file for this run

name: publish
on:
push:
branches: [master]
paths: ['package.json']
jobs:
diff:
runs-on: ubuntu-22.04
outputs:
previous: ${{ steps.version.outputs.previous }}
current: ${{ steps.version.outputs.current }}
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 2
- id: version
run: |
previous=$(git show HEAD^:package.json | grep '"version"' | awk -F '"' '{print $4}')
current=$(git show HEAD:package.json | grep '"version"' | awk -F '"' '{print $4}')
echo "previous=v$previous" >> $GITHUB_OUTPUT
echo "current=v$current" >> $GITHUB_OUTPUT
create-tag:
needs: diff
runs-on: ubuntu-22.04
outputs:
tag: ${{ steps.tag.outputs.tag }}
if: needs.diff.outputs.previous != needs.diff.outputs.current
steps:
- uses: actions/checkout@v4
- id: tag
run: |
tag=${{ needs.diff.outputs.current }}
git tag $tag
git push origin $tag
echo "tag=$tag" >> $GITHUB_OUTPUT
create-release:
needs: create-tag
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
- uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ needs.create-tag.outputs.tag }}
release_name: ${{ needs.create-tag.outputs.tag }}
draft: false
prerelease: false
npm-publish:
needs: create-release
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 20
registry-url: https://registry.npmjs.org
- env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
run: |
npm ci
npm run build
npm publish