-
Notifications
You must be signed in to change notification settings - Fork 20
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
implement workflows for automatic releases (#22)
* implement workflows for automatic releases Signed-off-by: Lukas Hauser <[email protected]> * remove outdated docs Signed-off-by: Lukas Hauser <[email protected]> --------- Signed-off-by: Lukas Hauser <[email protected]>
- Loading branch information
Showing
4 changed files
with
78 additions
and
17 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,43 @@ | ||
name: Prepare new Release | ||
run-name: ${{ github.actor }} is preparing a new Release 🚀 | ||
on: | ||
workflow_dispatch: | ||
inputs: | ||
version: | ||
description: Define Harbor Version | ||
|
||
jobs: | ||
prepare_new_release: | ||
runs-on: ubuntu-latest | ||
permissions: | ||
contents: write | ||
pull-requests: write | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: Prepare Repository | ||
run: | | ||
git fetch | ||
git switch release-version-${{ github.event.inputs.version }} || git switch -c release-version-${{ github.event.inputs.version }} | ||
git config user.name ${{ github.actor }} | ||
git config user.email '${{ github.actor }}@users.noreply.github.com' | ||
- name: Update Version | ||
run: | | ||
sed -E "s/v[0-9]+\.[0-9]+\.[0-9]+/v${{ github.event.inputs.version }}/g" -i README.md | ||
sed -E "s/(VERSION := )v[0-9]+\.[0-9]+\.[0-9]+/\1v${{ github.event.inputs.version }}/g" -i Makefile | ||
make gen-harbor-api | ||
- name: Commit and Push Changes | ||
run: | | ||
git add -A | ||
git commit -m "Release Version ${{ github.event.inputs.version }}" || echo "Nothing to commit" | ||
git push origin release-version-${{ github.event.inputs.version }} | ||
- name: Create Pull Request | ||
run: | | ||
if gh pr view release-version-${{ github.event.inputs.version }}; then | ||
echo "Pull request release-version-${{ github.event.inputs.version }} already exists" | ||
exit 0 | ||
else | ||
echo "Creating Pull request release-version-${{ github.event.inputs.version }}" | ||
gh pr create -B main -H release-version-${{ github.event.inputs.version }} --title 'Release Version ${{ github.event.inputs.version }}' --body 'Created by Github action' | ||
fi | ||
env: | ||
GITHUB_TOKEN: ${{ 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,26 @@ | ||
name: Release new Version Tag | ||
run-name: ${{ github.actor }} is tagging a new Release 🚀 | ||
on: | ||
push: | ||
branches: | ||
- main | ||
|
||
jobs: | ||
release_version: | ||
runs-on: ubuntu-latest | ||
permissions: | ||
contents: write | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: create tag | ||
run: | | ||
version=$(make get-go-version) | ||
if gh release view ${version} &> /dev/null; then | ||
echo "Release ${version} already exists" | ||
exit 0 | ||
else | ||
echo "Creating Release ${version}" | ||
gh release create "${version}" | ||
fi | ||
env: | ||
GITHUB_TOKEN: ${{ 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
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