diff --git a/.github/workflows/CD_deployment.yml b/.github/workflows/CD_deployment.yml index 4c891ed..a64db31 100644 --- a/.github/workflows/CD_deployment.yml +++ b/.github/workflows/CD_deployment.yml @@ -78,3 +78,67 @@ jobs: file: ./poetry.Dockerfile push: true tags: ${{ env.DOCKERREPO }}:${{ matrix.tags }} + + run-on-schedule-version-bump: + name: 🗃️ Create Version Bump PR + runs-on: ubuntu-latest + permissions: + contents: write + issues: write + pull-requests: write + actions: write + needs: + - deploy + - get-tag + env: + TAG_VERSION: ${{ needs.get-tag.outputs.PACKAGE_VERSION }} + steps: + - + name: Checkout code with full history + uses: actions/checkout@v4 + with: + fetch-depth: 0 + token: ${{ secrets.WORKFLOW_TOKEN }} + - + name: Create new Branch + run: | + git fetch origin + git checkout -b update-run-on-schedule-version-${{ env.TAG_VERSION }} origin/master + git pull --rebase + git push origin update-run-on-schedule-version-${{ env.TAG_VERSION }} --force + env: + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} + - + name: Update Version in pyproject.toml + run: | + sed -i "s/^ DOCKER_IMAGE: \"octivbooker:.*\"/ DOCKER_IMAGE: \"octivbooker:v${{ env.TAG_VERSION }}\"/" .github/workflows/run-on-schedule.yml + - + name: Verify Update + run: cat .github/workflows/run-on-schedule.yml + - + 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 .github/workflows/run-on-schedule.yml + git commit -m "Update DOCKER_IMAGE: to ${{ env.TAG_VERSION }}" + git push origin update-run-on-schedule-version-${{ env.TAG_VERSION }} + - + name: Install GitHub CLI + run: | + sudo apt-get install gh + - + name: Create Pull Request + run: | + PR_EXISTS=$(gh pr list --head update-run-on-schedule-version-${{ env.TAG_VERSION }} --json number --jq '.[0].number' || echo "") + if [ -z "$PR_EXISTS" ]; then + gh pr create --title "Bump run-on-schedule.yml version to ${{ env.TAG_VERSION }}" \ + --body "This PR updates the version in run-on-schedule.yml to ${{ env.TAG_VERSION }}." \ + --base master \ + --head update-run-on-schedule-version-${{ env.TAG_VERSION }} + else + echo "PR already exists." + fi + env: + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} + \ No newline at end of file diff --git a/.github/workflows/CD_release.yml b/.github/workflows/CD_release.yml index dbd7e8c..3d26a91 100644 --- a/.github/workflows/CD_release.yml +++ b/.github/workflows/CD_release.yml @@ -16,7 +16,7 @@ on: jobs: release: - name: 🚀 Release + name: "🚀 Release" runs-on: ubuntu-latest permissions: contents: write # to be able to publish a GitHub release @@ -35,7 +35,7 @@ jobs: with: release-type: "python" - - name: 🏷️ Tag Major and Minor Versions + name: "🏷️ Tag Major and Minor Versions" if: ${{ steps.release.outputs.release_created }} run: | git config user.name github-actions[bot] @@ -50,6 +50,7 @@ jobs: git push origin v${{ steps.release.outputs.major }}.${{ steps.release.outputs.minor }} poetry-version-tag: + name: "🗃️ Create Version Bump PR" runs-on: ubuntu-latest permissions: contents: write @@ -108,10 +109,13 @@ jobs: run: | PR_EXISTS=$(gh pr list --head update-pyproject-version-$TAG_VERSION --json number --jq '.[0].number' || echo "") if [ -z "$PR_EXISTS" ]; then - 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 + 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 diff --git a/.github/workflows/CI_build-on-pr.yml b/.github/workflows/CI_build-on-pr.yml index bd90d76..a84a42c 100644 --- a/.github/workflows/CI_build-on-pr.yml +++ b/.github/workflows/CI_build-on-pr.yml @@ -11,7 +11,7 @@ on: jobs: test-and-lint: - name: Test & Lint + name: "🧰 Test & Lint" runs-on: ubuntu-latest outputs: PACKAGE_VERSION: ${{ steps.extract_version.outputs.PACKAGE_VERSION }} @@ -60,7 +60,7 @@ jobs: echo "PACKAGE_VERSION=$VERSION" >> $GITHUB_OUTPUT docker-test: - name: "Test Build Docker Image" + name: "🧰 Test Build Docker Image" runs-on: ubuntu-latest needs: test-and-lint steps: diff --git a/.github/workflows/run-on-schedule.yml b/.github/workflows/run-on-schedule.yml index 7d3dcd8..2a24f62 100644 --- a/.github/workflows/run-on-schedule.yml +++ b/.github/workflows/run-on-schedule.yml @@ -9,7 +9,6 @@ env: DOCKER_IMAGE: "octivbooker:v2.4.0" jobs: - # Step 1: Pull the Docker image and list subdirectories prepare: runs-on: ubuntu-latest outputs: @@ -29,9 +28,8 @@ jobs: echo "environment_dir_list=$ENV_SUBDIR_LIST" >> $GITHUB_OUTPUT echo $ENV_SUBDIR_LIST - # Step 2: Run OctivBooker for each subdirectory run-octivbooker: - name: Run OctivBooker ${{ matrix.environment }} + name: "🏋️‍♂️ Run OctivBooker ${{ matrix.environment }}" needs: prepare runs-on: ubuntu-latest strategy: