-
Notifications
You must be signed in to change notification settings - Fork 89
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
3 changed files
with
70 additions
and
5 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,17 @@ | ||
name: version update | ||
on: | ||
schedule: | ||
# 毎日 09:00 JST | ||
- cron: "0 0 * * *" | ||
jobs: | ||
build-linux: | ||
runs-on: ubuntu-22.04 | ||
steps: | ||
- uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 | ||
- name: Run versipn_update.sh | ||
# 自身のファイルがチェックアウトによって消えると困るので | ||
# コピーして消されないようにする | ||
cp ./scripts/version_update.sh _version_update.sh | ||
./_version_update.sh |
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,46 @@ | ||
#!/bin/bash | ||
|
||
set -ex | ||
|
||
cd $(dirname $0) | ||
|
||
# VERSION ファイルを適切なバージョンに更新するスクリプト | ||
# GitHub Actions から実行されることを想定している | ||
|
||
if [ "$GITHUB_ACTIONS" == "true" ]; then | ||
git config --global user.name "${GITHUB_ACTOR}" | ||
git config --global user.email "${GITHUB_ACTOR}@users.noreply.github.com" | ||
fi | ||
|
||
git checkout master | ||
REMOTE=$(git remote) | ||
|
||
# run.py に version_list や version_update が存在しないブランチにチェックアウトしてしまう可能性があるので、 | ||
# master ブランチの run.py の内容をコピーして利用する | ||
cp run.py _run.py | ||
|
||
LINES=$(python3 _run.py version_list | head -n 1) | ||
while read -r milestone branch position commit; do | ||
echo "${milestone} ${branch} ${position} ${commit}" | ||
STATUS=$(git branch -a | grep -q "remotes/${REMOTE}/feature/${milestone}.${branch}"; echo $?) | ||
if [ "$STATUS" == "0" ]; then | ||
git checkout "feature/${milestone}.${branch}" | ||
else | ||
git checkout -b "feature/${milestone}.${branch}" | ||
fi | ||
|
||
source VERSION | ||
python3 _run.py version_update ${milestone} | ||
STATUS=$(git diff --exit-code --quiet VERSION; echo $?) | ||
if [ "$STATUS" == "1" ]; then | ||
git add VERSION | ||
git commit -m "[update] Update version m$WEBRTC_VERSION to ${milestone}.${branch}.${position}" | ||
fi | ||
done <<< "$LINES" | ||
|
||
# GitHub Actions から実行する場合は push までやる | ||
if [ "$GITHUB_ACTIONS" == "true" ]; then | ||
git push origin --all | ||
fi | ||
|
||
git checkout master |