From 468fa70f1e2105d6d70c98f5e838cd2f80567379 Mon Sep 17 00:00:00 2001 From: Sebastian Blum <64776588+seblum@users.noreply.github.com> Date: Mon, 12 Aug 2024 23:05:35 +0200 Subject: [PATCH] fix: release manual poetry bump (#58) * 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 --- .github/workflows/CD_release.yml | 73 -------------------------------- 1 file changed, 73 deletions(-) diff --git a/.github/workflows/CD_release.yml b/.github/workflows/CD_release.yml index 2f799da..a57e774 100644 --- a/.github/workflows/CD_release.yml +++ b/.github/workflows/CD_release.yml @@ -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 }}