Skip to content

Commit

Permalink
Refactor: Use GitHub Actions for version bumping and release creation
Browse files Browse the repository at this point in the history
Update the release workflow to leverage GitHub Actions for version bumping and release creation. The workflow now uses `mathieudutour/github-tag-action` and `ncipollo/release-action` to simplify the process and ensure consistency.

This change removes the need for additional dependencies and configuration, streamlines the release process, and improves overall maintainability.
  • Loading branch information
RedAtman committed Jul 20, 2024
1 parent 24cc73c commit 725c76e
Showing 1 changed file with 30 additions and 24 deletions.
54 changes: 30 additions & 24 deletions .github/workflows/create-release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,30 +14,36 @@ jobs:
- name: Checkout code
uses: actions/checkout@v4

- name: Set up Git
run: |
git config --global user.name "github-actions[bot]"
git config --global user.email "github-actions[bot]@users.noreply.github.com"
- name: Extract current version
id: extract_version
run: |
# Extract the current version from the VERSION file
VERSION=$(cat VERSION)
echo "Current version: $VERSION"
echo "::set-output name=current_version::$VERSION"
- uses: paulhatch/[email protected]
id: generate-version
- name: Bump version and push tag
id: tag_version
uses: mathieudutour/[email protected]
with:
tag_prefix: "st4-"
major_pattern: "(MAJOR)"
minor_pattern: "(MINOR)"
version_format: "st4-${major}.${minor}.${patch}"

- name: Create Release
id: create-release
uses: undergroundwires/[email protected]
github_token: ${{ secrets.GITHUB_TOKEN }}
- name: Create a GitHub release
uses: ncipollo/release-action@v1
with:
git-token: ${{ secrets.ACTION_TOKEN }}
release-token: ${{ secrets.ACTION_TOKEN }}
tag_prefix: "st4-"
tag: ${{ steps.tag_version.outputs.new_tag }}
name: Release ${{ steps.tag_version.outputs.new_tag }}
body: ${{ steps.tag_version.outputs.changelog }}

# - name: Set up Git
# run: |
# git config --global user.name "github-actions[bot]"
# git config --global user.email "github-actions[bot]@users.noreply.github.com"

# - uses: paulhatch/[email protected]
# id: generate-version
# with:
# tag_prefix: "st4-"
# major_pattern: "(MAJOR)"
# minor_pattern: "(MINOR)"
# version_format: "st4-${major}.${minor}.${patch}"

# - name: Create Release
# id: create-release
# uses: undergroundwires/[email protected]
# with:
# git-token: ${{ secrets.ACTION_TOKEN }}
# release-token: ${{ secrets.ACTION_TOKEN }}

0 comments on commit 725c76e

Please sign in to comment.