Skip to content

Commit

Permalink
FIX: push to v1 etc for version branches (#18)
Browse files Browse the repository at this point in the history
  • Loading branch information
redeboer authored Jan 13, 2024
1 parent 425dd92 commit 646d604
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 3 deletions.
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

0 comments on commit 646d604

Please sign in to comment.