-
Notifications
You must be signed in to change notification settings - Fork 0
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
Felix Wenzel
authored and
Felix Wenzel
committed
Jan 9, 2024
1 parent
4a67a0d
commit fa5bb4d
Showing
3 changed files
with
71 additions
and
2 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
name: Init Release | ||
on: | ||
workflow_dispatch: | ||
inputs: | ||
TARGET_VERSION: | ||
description: 'TARGET_VERSION to build manifests (e.g. 2.5.0-rc1) Note: the `v` prefix is not used' | ||
required: true | ||
type: string | ||
|
||
jobs: | ||
prepare-release: | ||
permissions: | ||
contents: write # for peter-evans/create-pull-request to create branch | ||
pull-requests: write # for peter-evans/create-pull-request to create a PR | ||
name: Automatically generate version and manifests on ${{ inputs.TARGET_VERSION }} | ||
runs-on: ubuntu-22.04 | ||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v3 | ||
with: | ||
fetch-depth: 0 | ||
ref: main | ||
|
||
- name: Check if TARGET_VERSION is well formed. | ||
run: | | ||
set -xue | ||
# Target version must not contain 'v' prefix | ||
if echo "${{ inputs.TARGET_VERSION }}" | grep -e '^v'; then | ||
echo "::error::Target version '${{ inputs.TARGET_VERSION }}' should not begin with a 'v' prefix, refusing to continue." >&2 | ||
exit 1 | ||
fi | ||
- name: create pull request | ||
run: | | ||
git checkout -b releases/${{ inputs.TARGET_VERSION }} | ||
git push --set-upstream origin releases/${{ inputs.TARGET_VERSION }} | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
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,31 @@ | ||
name: Release Charts | ||
|
||
on: | ||
push: | ||
tags: | ||
- "v*.*.*" | ||
|
||
jobs: | ||
release: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
with: | ||
fetch-depth: 0 | ||
|
||
- name: Replace version | ||
run: | | ||
cd charts/azure-clientid-syncer-webhook | ||
sed -i "s/version:.*/version: ${{ github.ref }}/g" Chart.yaml | ||
cat Chart.yaml | ||
- name: Configure Git | ||
run: | | ||
git config user.name "$GITHUB_ACTOR" | ||
git config user.email "[email protected]" | ||
- name: Run chart-releaser | ||
uses: helm/[email protected] | ||
env: | ||
CR_TOKEN: "${{ secrets.GITHUB_TOKEN }}" |
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