Skip to content

Commit

Permalink
chore: updates release step
Browse files Browse the repository at this point in the history
  • Loading branch information
jakeherp committed Apr 19, 2023
1 parent 1cc1d0f commit 40337a1
Showing 1 changed file with 20 additions and 8 deletions.
28 changes: 20 additions & 8 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -59,21 +59,33 @@ jobs:
git add CHANGELOG.md package.json
git commit -m "chore(release): $new_version [skip ci]"
git push origin HEAD:main
- name: Get current version number
- name: Get current version
id: get_version
run: echo "::set-env name=PACKAGE_VERSION::$(node -p -e "require('./package.json').version")"
shell: bash
- name: Set previous version
id: set_previous_version
run: echo "::set-env name=PREVIOUS_VERSION::$(git describe --tags --abbrev=0)"
shell: bash
- name: Bump version
id: bump_version
run: |
version=$(grep '"version":' package.json | awk -F'"' '{print $4}')
echo "::set-output name=version::$version"
npx semver --increment ${{ env.BUMP_TYPE }} ${{ env.PACKAGE_VERSION }} --preid=beta.${{ github.run_number }} -i -f -p 'beta' > version.txt
echo "::set-env name=NEW_VERSION::$(cat version.txt)"
shell: bash
- name: Update package.json
run: |
npm version --no-git-tag-version $(cat version.txt)
shell: bash
- name: Create a new release
if: github.ref == 'refs/heads/main' && github.event_name == 'push'
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}
with:
tag_name: v${{ steps.get_version.outputs.version }} # Construct the tag name based on the version number
release_name: Release ${{ steps.get_version.outputs.version }}
tag_name: ${{ env.NEW_VERSION }}
release_name: Release ${{ env.NEW_VERSION }}
body: |
Release v${{ steps.get_version.outputs.version }}
$(cat CHANGELOG.md)
${{ steps.generate_release_notes.outputs.release_notes }}
draft: false
prerelease: false

Expand Down

0 comments on commit 40337a1

Please sign in to comment.