Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixing the automation triggers for other branches #3125

Merged
merged 3 commits into from
Oct 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions .github/workflows/release_finalize.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,15 @@
name: release-finalize
on:
workflow_dispatch:
delete:
branches: [misc/prepare-release-*]
pull_request:
types: [closed]
branches: ["misc/prepare-release-*"]
env:
ZENML_ANALYTICS_OPT_IN: false
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
jobs:
fetch-versions:
if: github.repository == 'zenml-io/zenml'
if: github.repository == 'zenml-io/zenml' && github.event.pull_request.merged == true && startsWith(github.event.pull_request.head.ref, 'misc/prepare-release-')
runs-on: ubuntu-latest
outputs:
old_version: ${{ steps.old-version.outputs.old_version }}
Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/release_prepare.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@ name: release-prepare
on:
workflow_dispatch:
create:
branches: [misc/prepare-release-*]
branches: ["misc/prepare-release-*"]
types: [branch]
env:
ZENML_ANALYTICS_OPT_IN: false
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Expand Down
2 changes: 1 addition & 1 deletion scripts/format.sh
Original file line number Diff line number Diff line change
Expand Up @@ -64,5 +64,5 @@ ruff format $SRC

# standardizes / formats CI yaml files
if [ "$SKIP_YAMLFIX" = false ]; then
yamlfix .github tests --exclude "dependabot.yml"
yamlfix .github tests -e "dependabot.yml" -e "workflows/release_prepare.yml" -e "workflows/release_finalize.yml"
fi
6 changes: 6 additions & 0 deletions scripts/validate-new-version.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,12 @@ fi
# Input: new planned version
PLANNED_VERSION="$1"

# Check if the version fits the SemVer formatting
if [[ ! "$PLANNED_VERSION" =~ ^[0-9]+(\.[0-9]+){2}$ ]]; then
echo "::error::Error: Invalid version format '$PLANNED_VERSION'. The version must be in the format X.X.X (e.g., 0.4.0, 1.21.51)."
exit 1
fi

# Get the latest release information
LATEST_RELEASE=$(gh release view --json tagName,publishedAt -q '{tag: .tagName, date: .publishedAt}')

Expand Down
Loading