Merge pull request #42 from daiwanxing/test-fix/useInterceptor #52
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: release | |
on: | |
push: | |
branches: | |
- main | |
pull_request: | |
branches: | |
- main | |
jobs: | |
check: | |
runs-on: ubuntu-latest | |
outputs: | |
version: ${{ steps.info.outputs.version }} | |
exists: ${{ steps.checkTag.outputs.exists }} | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
- name: Read package.json INFO | |
id: info | |
uses: jaywcjlove/github-action-package@main | |
- run: echo "version - ${{ steps.info.outputs.version }}" | |
- name: Check if tag exist | |
id: checkTag | |
uses: mukunku/[email protected] | |
if: steps.info.outputs.version != '' | |
with: | |
tag: 'v${{steps.info.outputs.version}}' | |
- run: echo "exists - ${{ steps.checkTag.outputs.exists }}" | |
release: | |
runs-on: ubuntu-latest | |
needs: check | |
if: needs.check.outputs.exists == 'false' | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: pnpm/action-setup@v3 | |
- uses: actions/setup-node@v3 | |
with: | |
node-version-file: .nvmrc | |
cache: pnpm | |
registry-url: https://registry.npmjs.org | |
- run: corepack enable | |
- run: pnpm install | |
- run: pnpm publish --access public --no-git-checks | |
env: | |
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} | |
- name: Release | |
uses: softprops/action-gh-release@v1 | |
with: | |
tag_name: 'v${{needs.check.outputs.version}}' |