Skip to content

Commit

Permalink
ci: remove publish abstraction
Browse files Browse the repository at this point in the history
  • Loading branch information
trezy committed Aug 1, 2024
1 parent 63dd479 commit 3e29c02
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 60 deletions.
54 changes: 0 additions & 54 deletions .github/actions/publish-release/action.yml

This file was deleted.

35 changes: 29 additions & 6 deletions .github/workflows/handle-release-branch-push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,32 @@ jobs:
with:
fetch-depth: 0

- name: Publish release
uses: ./.github/actions/publish-release
with:
branchName: ${{ github.head_ref || github.ref_name }}
githubToken: ${{ secrets.GITHUB_TOKEN }}
npmToken: ${{ secrets.NPM_TOKEN }}
- name: Setup Project
uses: ./.github/actions/setup

- name: Build Project
run: npm run build
shell: bash

- name: Get Next Release Version
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
id: get_release_version
run: |
export NEXT_TAG_VERSION=$(npx semantic-release --dry-run | grep 'The next release version is' | sed -E 's/.* ([[:digit:].]+)$/\1/')
echo "new_tag_version=${NEXT_TAG_VERSION}" >> $GITHUB_OUTPUT
shell: bash

- name: Semantic Release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
if: ${{ steps.get_release_version.outputs.new_tag_version != '' }}
run: npx semantic-release
shell: bash

- name: Publish to npm
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
if: ${{ steps.get_release_version.outputs.new_tag_version != '' }}
run: npm publish ./dist/*.tgz --tag ${{ (github.head_ref || github.ref_name) == 'main' && 'latest' || github.head_ref || github.ref_name }}
shell: bash

0 comments on commit 3e29c02

Please sign in to comment.