Skip to content

types: type safer implementation for sum function (#358) (#359) #96

types: type safer implementation for sum function (#358) (#359)

types: type safer implementation for sum function (#358) (#359) #96

name: 'Release'
on:
push:
branches: [master]
jobs:
check:
name: 'Check if release is needed'
runs-on: 'ubuntu-latest'
outputs:
exists: ${{ steps.check-tag.outputs.exists }}
steps:
- uses: actions/checkout@v3
- name: Get Current Version
id: get-version
run: echo "version=$(jq -r .version package.json)" >> $GITHUB_OUTPUT
- uses: mukunku/[email protected]
id: check-tag
with:
tag: v${{ steps.get-version.outputs.version }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
release:
name: 'Release'
needs: check
if: needs.check.outputs.exists == 'false'
runs-on: 'ubuntu-latest'
steps:
- uses: actions/checkout@v3
- name: Get Current Version
id: get-version
run: echo "version=$(jq -r .version package.json)" >> $GITHUB_OUTPUT
- name: Create Release
uses: actions/create-release@v1
id: create-release
with:
draft: false
prerelease: false
release_name: v${{ steps.get-version.outputs.version}}
tag_name: v${{ steps.get-version.outputs.version}}
env:
GITHUB_TOKEN: ${{ github.token }}
publish:
runs-on: ubuntu-latest
needs: check
if: needs.check.outputs.exists == 'false'
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: 18
registry-url: 'https://registry.npmjs.org'
- run: yarn
- run: yarn build
- run: npm publish
env:
NODE_AUTH_TOKEN: '${{ secrets.NPM_TOKEN }}'