Skip to content

Commit

Permalink
fix: release manual poetry bump (#58)
Browse files Browse the repository at this point in the history
* feat: switch run to utc 1855

* feat: add EMAIL_RECEIVER_NAME

* feat: add autocommit to version and pr creation for scheduler modification

* fix: yml path

* fix: add env version to job

* fix: pathspec

* feat: add env.TAG insert

* test: add cd

* test: remove echo

* add pwd

* add pwd

* add ls

* add ls

* add spaces

* use intendation

* feat: add workflows permissions

* feat: add workflows permissions

* test: write all

* revert write all

* add env

* test different tokens

* add token

* add token GH

* set token in checkout

* style: add emojis

* feat: remove on pr test

* fix: release on any push master

* minor change in dir

* fix: remove manuall poetry bump
  • Loading branch information
seblum authored Aug 12, 2024
1 parent 56793e1 commit 468fa70
Showing 1 changed file with 0 additions and 73 deletions.
73 changes: 0 additions & 73 deletions .github/workflows/CD_release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,76 +43,3 @@ jobs:
git tag -a v${{ steps.release.outputs.major }}.${{ steps.release.outputs.minor }} -m "Release v${{ steps.release.outputs.major }}.${{ steps.release.outputs.minor }}"
git push origin v${{ steps.release.outputs.major }}
git push origin v${{ steps.release.outputs.major }}.${{ steps.release.outputs.minor }}
poetry-version-tag:
name: "🗃️ Create Poetry Version Bump PR"
runs-on: ubuntu-latest
permissions:
contents: write
issues: write
pull-requests: write
needs: release
if: ${{ needs.release.outputs.release_created }}
steps:
-
name: Checkout code with full history
uses: actions/checkout@v4
with:
fetch-depth: 0
-
name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.x'
-
name: Extract tag version
id: extract_version
run: |
TAG_VERSION=$(git describe --match "v*.*.*" --tags --abbrev=0 | sed 's/^v//' || echo "no-tags")
echo "TAG_VERSION=$TAG_VERSION" >> $GITHUB_ENV
echo "Extracted tag version: $TAG_VERSION"
-
name: Create new Branch
run: |
git fetch origin
git checkout -b update-pyproject-version-$TAG_VERSION origin/master
git pull --rebase
git push origin update-pyproject-version-$TAG_VERSION --force
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
-
name: Update Version in pyproject.toml
run: |
sed -i "s/^version = \".*\"/version = \"$TAG_VERSION\"/" ./pyproject.toml
-
name: Verify Update
run: cat ./pyproject.toml
-
name: Commit changes
run: |
git config --global user.name 'github-actions[bot]'
git config --global user.email 'github-actions[bot]@users.noreply.github.com'
git add ./pyproject.toml
git commit -m "Update version to $TAG_VERSION"
git push origin update-pyproject-version-$TAG_VERSION
-
name: Install GitHub CLI
run: |
sudo apt-get install gh
-
name: Create Pull Request
run: |
PR_EXISTS=$(gh pr list --head update-pyproject-version-$TAG_VERSION --json number --jq '.[0].number' || echo "")
if [ -z "$PR_EXISTS" ]; then
PR_URL=$(gh pr create --title "Bump pyproject.toml version to $TAG_VERSION" \
--body "This PR updates the version in pyproject.toml to $TAG_VERSION." \
--base master \
--head update-pyproject-version-$TAG_VERSION \
--json url --jq '.url')
echo "Created PR: $PR_URL"
gh pr merge --auto --squash --delete-branch $PR_URL
else
echo "PR already exists."
fi
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}

0 comments on commit 468fa70

Please sign in to comment.