Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

(Fix) release yaml #16

Merged
merged 1 commit into from
May 30, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 8 additions & 9 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -70,29 +70,28 @@ jobs:
dist/*.whl
dist/*.tar.gz

# Configure git for committing version bump
- name: Configure git for committing version bump
run: |
git config --global user.name "github-actions[bot]"
git config --global user.email "github-actions[bot]@users.noreply.github.com"

# Bump version
- name: Bump version
id: bump_version
run: |
NEW_VERSION=$(poetry version patch | awk '{print $NF}')
echo "New version: $NEW_VERSION"
echo "new_version=$NEW_VERSION" >> $GITHUB_ENV
git commit -am "Bump version to $NEW_VERSION"
git add pyproject.toml
git commit -m "Bump version to $NEW_VERSION"

# Push version bump
- name: Push version bump
run: |
# Check out the main branch explicitly
git checkout main

# Tag the release
DEFAULT_BRANCH=$(git symbolic-ref refs/remotes/origin/HEAD | sed 's@^refs/remotes/origin/@@')
git checkout $DEFAULT_BRANCH
git tag -a v${{ env.new_version }} -m "Release v${{ env.new_version }}"

# Push the tag
git push --follow-tags
git push origin $DEFAULT_BRANCH --tags
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

Loading