-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(ci): add workflows for release process
* move scripts to folder dev-tools * add new workflow gradle-release.yml * add new workflow setversion-tag.yml * rename existing workflow
- Loading branch information
1 parent
c8d7e5f
commit 480fc75
Showing
7 changed files
with
184 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,89 @@ | ||
name: Run Gradle Release | ||
run-name: "Releasing Kestra ${{ github.event.inputs.releaseVersion }} 🚀" | ||
on: | ||
workflow_dispatch: | ||
inputs: | ||
releaseVersion: | ||
description: 'The release version (e.g., 0.21.0-rc1)' | ||
required: true | ||
type: string | ||
nextVersion: | ||
description: 'The next version (e.g., 0.22.0-SNAPSHOT)' | ||
required: true | ||
type: string | ||
env: | ||
RELEASE_VERSION: "${{ github.event.inputs.releaseVersion }}" | ||
NEXT_VERSION: "${{ github.event.inputs.nextVersion }}" | ||
jobs: | ||
release: | ||
name: Release Kestra | ||
runs-on: ubuntu-latest | ||
if: github.ref == 'refs/heads/develop' | ||
steps: | ||
# Checks | ||
- name: Check Inputs | ||
run: | | ||
if ! [[ "$RELEASE_VERSION" =~ ^[0-9]+(\.[0-9]+)\.0-rc[01](-SNAPSHOT)?$ ]]; then | ||
echo "Invalid release version. Must match regex: ^[0-9]+(\.[0-9]+)\.0-rc[01](-SNAPSHOT)?$" | ||
exit 1 | ||
fi | ||
if ! [[ "$NEXT_VERSION" =~ ^[0-9]+(\.[0-9]+)\.0-SNAPSHOT$ ]]; then | ||
echo "Invalid next version. Must match regex: ^[0-9]+(\.[0-9]+)\.0-SNAPSHOT$" | ||
exit 1; | ||
fi | ||
# Checkout | ||
- uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 | ||
|
||
# Checkout GitHub Actions | ||
- uses: actions/checkout@v4 | ||
with: | ||
repository: kestra-io/actions | ||
path: actions | ||
ref: main | ||
|
||
# Setup build | ||
- uses: ./actions/.github/actions/setup-build | ||
id: build | ||
with: | ||
java-enabled: true | ||
node-enabled: true | ||
python-enabled: true | ||
caches-enabled: true | ||
|
||
- name: Configure Git | ||
run: | | ||
git config --global user.email "41898282+github-actions[bot]@users.noreply.github.com" | ||
git config --global user.name "github-actions[bot]" | ||
# Execute | ||
- name: Run Gradle Release | ||
env: | ||
GITHUB_PAT: ${{ secrets.GH_PERSONAL_TOKEN }} | ||
run: | | ||
# Extract the major and minor versions | ||
BASE_VERSION=$(echo "$RELEASE_VERSION" | sed -E 's/^([0-9]+\.[0-9]+)\..*/\1/') | ||
PUSH_RELEASE_BRANCH="releases/v${BASE_VERSION}.x" | ||
# Create and push release branch | ||
git checkout -b "$PUSH_RELEASE_BRANCH"; | ||
git push -u origin "$PUSH_RELEASE_BRANCH"; | ||
|
||
# Run gradle release | ||
git checkout develop; | ||
|
||
if [[ "$RELEASE_VERSION" == *"-SNAPSHOT" ]]; then | ||
# -SNAPSHOT qualifier maybe used to test release-candidates | ||
./gradlew release -Prelease.useAutomaticVersion=true \ | ||
-Prelease.releaseVersion="${RELEASE_VERSION}" \ | ||
-Prelease.newVersion="${NEXT_VERSION}" \ | ||
-Prelease.pushReleaseVersionBranch="${PUSH_RELEASE_BRANCH}" \ | ||
-Prelease.failOnSnapshotDependencies=false | ||
else | ||
./gradlew release -Prelease.useAutomaticVersion=true \ | ||
-Prelease.releaseVersion="${RELEASE_VERSION}" \ | ||
-Prelease.newVersion="${NEXT_VERSION}" \ | ||
-Prelease.pushReleaseVersionBranch="${PUSH_RELEASE_BRANCH}" | ||
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,74 @@ | ||
name: Set Version and Tag | ||
run-name: "Set version and Tag Kestra to ${{ github.event.inputs.releaseVersion }} 🚀" | ||
on: | ||
workflow_dispatch: | ||
inputs: | ||
releaseVersion: | ||
description: 'The release version (e.g., 0.21.1)' | ||
required: true | ||
type: string | ||
env: | ||
RELEASE_VERSION: "${{ github.event.inputs.releaseVersion }}" | ||
jobs: | ||
release: | ||
name: Release Kestra | ||
runs-on: ubuntu-latest | ||
if: startsWith(github.ref, 'refs/heads/releases/v') | ||
steps: | ||
# Checks | ||
- name: Check Inputs | ||
run: | | ||
if ! [[ "$RELEASE_VERSION" =~ ^[0-9]+(\.[0-9]+)(\.[0-9]+)(-rc[0-9])?(-SNAPSHOT)?$ ]]; then | ||
echo "Invalid release version. Must match regex: ^[0-9]+(\.[0-9]+)(\.[0-9]+)-(rc[0-9])?(-SNAPSHOT)?$" | ||
exit 1 | ||
fi | ||
CURRENT_BRANCH="{{ github.ref }}" | ||
# Extract the major and minor versions | ||
BASE_VERSION=$(echo "$RELEASE_VERSION" | sed -E 's/^([0-9]+\.[0-9]+)\..*/\1/') | ||
RELEASE_BRANCH="refs/heads/releases/v${BASE_VERSION}.x" | ||
if ! [[ "$CURRENT_BRANCH" == "$RELEASE_BRANCH" ]]; then | ||
echo "Invalid release branch. Expected $RELEASE_BRANCH, was $CURRENT_BRANCH" | ||
exit 1 | ||
fi | ||
# Checkout | ||
- uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 | ||
|
||
# Checkout GitHub Actions | ||
- uses: actions/checkout@v4 | ||
with: | ||
repository: kestra-io/actions | ||
path: actions | ||
ref: main | ||
|
||
# Setup build | ||
- uses: ./actions/.github/actions/setup-build | ||
id: build | ||
with: | ||
java-enabled: true | ||
node-enabled: true | ||
python-enabled: true | ||
caches-enabled: true | ||
|
||
- name: Configure Git | ||
run: | | ||
git config --global user.email "41898282+github-actions[bot]@users.noreply.github.com" | ||
git config --global user.name "github-actions[bot]" | ||
# Execute | ||
- name: Run Gradle Release | ||
env: | ||
GITHUB_PAT: ${{ secrets.GH_PERSONAL_TOKEN }} | ||
run: | | ||
# Update version | ||
sed -i "s/^version=.*/version=$RELEASE_VERSION/" ./gradle.properties | ||
git add ./gradle.properties | ||
git commit -m"chore(version): update to version '$RELEASE_VERSION'" | ||
git push | ||
git tag -a "v$RELEASE_VERSION" -m"v$RELEASE_VERSION" | ||
git push origin "v$RELEASE_VERSION" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters