-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore(workflow): add "update repo version file in default branch (mas…
…ter/main)" Longhorn 8981 Signed-off-by: Derek Su <[email protected]>
- Loading branch information
Showing
2 changed files
with
76 additions
and
0 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,33 @@ | ||
name: Update Longhorn Repository Version File in Default Branch (master/main) | ||
|
||
on: | ||
workflow_dispatch: | ||
inputs: | ||
version: | ||
description: "Version, ex: v1.8.0-dev" | ||
required: true | ||
|
||
defaults: | ||
run: | ||
shell: bash | ||
|
||
jobs: | ||
release: | ||
runs-on: ubuntu-latest | ||
|
||
env: | ||
GITHUB_TOKEN: ${{ secrets.GH_ACTION_TOKEN }} | ||
|
||
steps: | ||
- name: Setup Git | ||
run: | | ||
gh auth setup-git | ||
- run: | | ||
git config --global user.email "[email protected]" | ||
git config --global user.name "David Ko" | ||
- uses: actions/checkout@v4 | ||
|
||
- name: Update repo version files | ||
run: ./scripts/update-repo-version-file.sh ${{ inputs.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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
#!/usr/bin/env bash | ||
|
||
set -o errexit | ||
set -o xtrace | ||
|
||
if [ "$#" -ne 1 ]; then | ||
echo "Illegal number of arguments. version are required." >/dev/stderr | ||
exit 1 | ||
fi | ||
|
||
version=$1 | ||
repos_dir=.repos | ||
|
||
repos=( | ||
"longhorn/longhorn-manager" | ||
"longhorn/longhorn-instance-manager" | ||
"longhorn/longhorn-engine" | ||
"longhorn/longhorn-share-manager" | ||
"longhorn/backing-image-manager" | ||
"longhorn/longhorn-ui" | ||
"longhorn/cli" | ||
# "longhorn/longhorn-spdk-engine" only needed since GA | ||
) | ||
|
||
function teardown() { | ||
rm -rf $repos_dir | ||
} | ||
trap teardown EXIT | ||
|
||
mkdir -p $repos_dir | ||
|
||
pushd $repos_dir | ||
for repo in "${repos[@]}"; do | ||
gh repo clone "${repo}" | ||
|
||
pushd "${repo##*/}" | ||
echo ${version} > version | ||
git add version | ||
git commit -s -m "chore(version): update version file to ${version}" | ||
git push -u origin HEAD | ||
popd | ||
done | ||
popd |