Skip to content

Commit

Permalink
chore: Add automated release and tag creation workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
lavie committed Jan 29, 2025
1 parent e6230a4 commit bfc8e0e
Show file tree
Hide file tree
Showing 2 changed files with 41 additions and 2 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/publish.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
on:
push:
branches: ["master"]
release:
types: [published]
jobs:
publish:
runs-on: ubuntu-latest
Expand Down
39 changes: 39 additions & 0 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: Create Release

on:
push:
branches: ["master"]

jobs:
release:
runs-on: ubuntu-latest
# Only run this job if we're not already creating a release
if: "!contains(github.event.head_commit.message, 'chore(release):')"

steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
token: ${{ secrets.GITHUB_TOKEN }}

- name: Get Version
id: get_version
run: |
VERSION=$(poetry run ./current_version.py)
echo "version=$VERSION" >> $GITHUB_OUTPUT
- name: Create Tag
run: |
git tag v${{ steps.get_version.outputs.version }}
git push origin v${{ steps.get_version.outputs.version }}
- name: Create Release
uses: softprops/action-gh-release@v1
with:
tag_name: v${{ steps.get_version.outputs.version }}
name: Release v${{ steps.get_version.outputs.version }}
draft: false
prerelease: false
generate_release_notes: true
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

0 comments on commit bfc8e0e

Please sign in to comment.