Skip to content

Commit

Permalink
Merge branch 'master' into release-please--branches--master
Browse files Browse the repository at this point in the history
  • Loading branch information
seblum authored Aug 12, 2024
2 parents 402bf27 + e339a06 commit 0b3975c
Show file tree
Hide file tree
Showing 4 changed files with 77 additions and 11 deletions.
64 changes: 64 additions & 0 deletions .github/workflows/CD_deployment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}

16 changes: 10 additions & 6 deletions .github/workflows/CD_release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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]
Expand All @@ -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
Expand Down Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/CI_build-on-pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
Expand Down Expand Up @@ -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:
Expand Down
4 changes: 1 addition & 3 deletions .github/workflows/run-on-schedule.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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:
Expand Down

0 comments on commit 0b3975c

Please sign in to comment.