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: push to v1 etc for version branches #18

Merged
merged 1 commit into from
Jan 13, 2024
Merged
Show file tree
Hide file tree
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
23 changes: 20 additions & 3 deletions .github/workflows/cd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,24 @@ jobs:
milestone:
if: startsWith(github.ref, 'refs/tags')
uses: ComPWA/actions/.github/workflows/close-milestone.yml@v1
push:
push-to-version-branches:
name: Push to version branches
if: startsWith(github.ref, 'refs/tags') && !github.event.release.prerelease
secrets: inherit
uses: ComPWA/actions/.github/workflows/push-to-version-branches.yml@v1
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
- name: Configure Git credentials
run: |
git config --global user.name "GitHub Action"
git config --global user.email "41898282+github-actions[bot]@users.noreply.github.com"
- name: Push to matching minor version branch
env:
TAG: ${{ github.ref_name }}
run: |
re='^(v?)([0-9]+)\.([0-9]+)\.[0-9]+'
if [[ $TAG =~ $re ]]; then
MAJOR_VERSION="${BASH_REMATCH[2]}"
MINOR_VERSION="${BASH_REMATCH[2]}.${BASH_REMATCH[3]}"
git push origin HEAD:refs/heads/v$MAJOR_VERSION --force
git push origin HEAD:refs/heads/v$MINOR_VERSION --force
fi
1 change: 1 addition & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ repos:
- --no-notebooks
- --no-prettierrc
- --no-pypi
- --no-version-branches
- --pytest-single-threaded
- --repo-name=update-pip-constraints
- id: format-setup-cfg
Expand Down
Loading