diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 3e920fb..dd74372 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -31,5 +31,40 @@ jobs: - name: test uses: ./.github/actions/test - - name: publish - uses: ./.github/actions/publish + # Bump version + - name: Bump package version + shell: bash + run: | + yarn version $RELEASE_TYPE + echo "RELEASE_TAG=latest" >> $GITHUB_ENV + echo "NEW_VERSION=$(jq -r '.version' < package.json)" >> $GITHUB_ENV + env: + RELEASE_TYPE: ${{ inputs.releaseType }} + + - name: Update CHANGELOG.md + uses: 'zen8sol/update-changelog-action@0.1.5' + with: + newVersion: '${{ env.NEW_VERSION }}' + + # Publish package + - name: Publish + shell: bash + run: | + echo -e "\nnpmAuthToken: '${{ env.NODE_AUTH_TOKEN }}'" >> ./.yarnrc.yml + yarn npm publish --access public --tag ${{ env.RELEASE_TAG }} + env: + NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} + + # Commit + - name: Commit CHANGELOG.md and package.json changes and create tag + shell: bash + run: | + git config --global user.email "153127894+hexancore-bot@users.noreply.github.com" + git config --global user.name "Hexancore Bot" + git add "package.json" + git add "CHANGELOG.md" + git commit -m "chore: release ${{ env.NEW_VERSION }}" + git tag -m 'new version' ${{ env.NEW_VERSION }} + git push --follow-tags + #- name: publish + # uses: ./.github/actions/publish