-
Notifications
You must be signed in to change notification settings - Fork 62
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
9 changed files
with
124 additions
and
58 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 |
---|---|---|
|
@@ -3,7 +3,12 @@ name: Bump Version | |
on: | ||
repository_dispatch: | ||
types: | ||
- zitadel-released | ||
- zitadel-released | ||
workflow_dispatch: | ||
inputs: | ||
tag: | ||
description: 'ZITADEL Tag' | ||
required: false | ||
|
||
permissions: | ||
contents: write | ||
|
@@ -16,8 +21,46 @@ jobs: | |
contents: write | ||
pull-requests: write | ||
steps: | ||
- name: Validate the manually given input tag, if any | ||
if: ${{ (github.event_name == 'workflow_dispatch') && (github.event.inputs.tag != '') }} | ||
id: check-input | ||
run: | | ||
INPUT=${{github.event.inputs.tag}} | ||
if ! [[ ${INPUT} =~ ^v[0-9]+\.[0-9]+\.[0-9]+ ]]; then | ||
echo "supplied invalid version number: ${INPUT}!" | ||
echo "must be of schema: vX.X.X" | ||
exit 1 | ||
fi | ||
- name: Get Latest ZITADEL Release Version | ||
id: latest-tag | ||
uses: oprypin/find-latest-tag@v1 | ||
with: | ||
repository: zitadel/zitadel | ||
releases-only: true | ||
# ignore prereleases | ||
regex: '^v([0-9]+)\.([0-9]+)\.([0-9]+)$' | ||
|
||
- name: Decide on Target ZITADEL Version | ||
id: target-zitadel-version | ||
run: | | ||
INPUT=${{ github.event.inputs.tag }} | ||
LATEST=${{ steps.latest-tag.outputs.tag }} | ||
TARGET_ZITADEL_VERSION=${INPUT:-${LATEST}} | ||
echo "input tag: ${INPUT}" | ||
echo "latest tag: ${LATEST}" | ||
echo "going to target zitadel version: ${TARGET_ZITADEL_VERSION}" | ||
echo "tag=${TARGET_ZITADEL_VERSION}" >> $GITHUB_OUTPUT | ||
- name: Parse Target ZITADEL Version into Major, Minor, Patch | ||
id: parsed-target-zitadel-version | ||
uses: release-kit/semver@v2 | ||
with: | ||
source: string | ||
string: ${{ steps.target-zitadel-version.outputs.tag }} | ||
|
||
- id: checkout | ||
uses: actions/checkout@v3 | ||
uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 | ||
|
||
|
@@ -40,18 +83,19 @@ jobs: | |
echo "Chart Version: ${{ steps.current-chart-version.outputs.data }}" | ||
echo "ZITADEL Version: ${{ steps.current-zitadel-version.outputs.data }}" | ||
- name: Parse Last ZITADEL Version | ||
- name: Parse Currently ZITADEL Version into Major, Minor, Patch | ||
id: parsed-last-zitadel-version | ||
uses: booxmedialtd/ws-action-parse-semver@v1 | ||
uses: release-kit/semver@v2 | ||
with: | ||
input_string: ${{ steps.current-zitadel-version.outputs.data }} | ||
source: 'string' | ||
string: ${{ steps.current-zitadel-version.outputs.data }} | ||
|
||
- name: Set Version Type | ||
- name: Set Version Update Type | ||
id: set-version-type | ||
run: | | ||
[ ${{ github.event.client_payload.semanticoutputs.new_release_patch_version }} -gt ${{ steps.parsed-last-zitadel-version.outputs.patch }} ] && echo '::set-output name=type::PATCH' || true | ||
[ ${{ github.event.client_payload.semanticoutputs.new_release_minor_version }} -gt ${{ steps.parsed-last-zitadel-version.outputs.minor }} ] && echo '::set-output name=type::MINOR' || true | ||
[ ${{ github.event.client_payload.semanticoutputs.new_release_major_version }} -gt ${{ steps.parsed-last-zitadel-version.outputs.major }} ] && echo '::set-output name=type::MAJOR' || true | ||
[ ${{ steps.parsed-target-zitadel-version.outputs.patch }} -gt ${{ steps.parsed-last-zitadel-version.outputs.patch }} ] && echo 'type=PATCH' >> $GITHUB_OUTPUT || true | ||
[ ${{ steps.parsed-target-zitadel-version.outputs.minor }} -gt ${{ steps.parsed-last-zitadel-version.outputs.minor }} ] && echo 'type=MINOR' >> $GITHUB_OUTPUT || true | ||
[ ${{ steps.parsed-target-zitadel-version.outputs.major }} -gt ${{ steps.parsed-last-zitadel-version.outputs.major }} ] && echo 'type=MAJOR' >> $GITHUB_OUTPUT || true | ||
- name: Bump Chart Version | ||
uses: jessicalostinspace/[email protected] | ||
|
@@ -65,8 +109,7 @@ jobs: | |
with: | ||
valueFile: 'charts/zitadel/Chart.yaml' | ||
propertyPath: 'appVersion' | ||
value: ${{ github.event.client_payload.semanticoutputs.new_release_version }} | ||
updateFile: true | ||
value: ${{ steps.target-zitadel-version.outputs.tag }} | ||
commitChange: false | ||
createPR: false | ||
|
||
|
@@ -76,7 +119,6 @@ jobs: | |
valueFile: 'charts/zitadel/Chart.yaml' | ||
propertyPath: 'version' | ||
value: ${{ steps.bumped-chart-version.outputs.bumped-semantic-version }} | ||
updateFile: true | ||
commitChange: false | ||
createPR: false | ||
|
||
|
@@ -85,7 +127,7 @@ jobs: | |
|
||
- name: Create Pull Request | ||
id: pull-request | ||
uses: peter-evans/create-pull-request@v4 | ||
uses: peter-evans/create-pull-request@v6 | ||
with: | ||
title: Bump ZITADEL Version | ||
branch: create-pull-request/bump | ||
|
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 |
---|---|---|
|
@@ -14,7 +14,7 @@ jobs: | |
runs-on: ubuntu-latest | ||
steps: | ||
- name: add issue | ||
uses: actions/add-to-project@v0.5.0 | ||
uses: actions/add-to-project@v1.0.2 | ||
if: ${{ github.event_name == 'issues' }} | ||
with: | ||
# You can target a repository in a different organization | ||
|
@@ -28,14 +28,14 @@ jobs: | |
username: ${{ github.actor }} | ||
GITHUB_TOKEN: ${{ secrets.ADD_TO_PROJECT_PAT }} | ||
- name: add pr | ||
uses: actions/add-to-project@v0.5.0 | ||
uses: actions/add-to-project@v1.0.2 | ||
if: ${{ github.event_name == 'pull_request_target' && github.actor != 'dependabot[bot]' && !contains(steps.checkUserMember.outputs.teams, 'engineers')}} | ||
with: | ||
# You can target a repository in a different organization | ||
# to the issue | ||
project-url: https://github.com/orgs/zitadel/projects/2 | ||
github-token: ${{ secrets.ADD_TO_PROJECT_PAT }} | ||
- uses: actions-ecosystem/[email protected].0 | ||
- uses: actions-ecosystem/[email protected].3 | ||
if: ${{ github.event_name == 'pull_request_target' && github.actor != 'dependabot[bot]' && !contains(steps.checkUserMember.outputs.teams, 'staff')}} | ||
with: | ||
github_token: ${{ secrets.ADD_TO_PROJECT_PAT }} | ||
|
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
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
Oops, something went wrong.