-
Notifications
You must be signed in to change notification settings - Fork 36
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
136 changed files
with
1,968 additions
and
1,547 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,99 @@ | ||
name: 1.18 build check | ||
|
||
on: | ||
push: | ||
branches: | ||
- 1_18 | ||
paths: | ||
- src/** | ||
- build.sbt | ||
- .scalafix.conf | ||
- .scalafmt.conf | ||
- project/* | ||
- .github/workflows/**.yml | ||
- .github/actions/**/**.yml | ||
|
||
jobs: | ||
build_check: | ||
env: | ||
BUILD_ENVIRONMENT_IS_CI_OR_LOCAL: "CI" | ||
runs-on: ubuntu-20.04 | ||
container: ghcr.io/giganticminecraft/seichiassist-builder-v2:424c09f | ||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v3 | ||
with: | ||
submodules: 'recursive' | ||
|
||
- name: Prepare build dependencies cache | ||
uses: actions/cache@v3 | ||
env: | ||
cache-name: cache-build-dependencies | ||
cache-version: v-5 | ||
with: | ||
# sbt等は$HOMEではなくユーザーディレクトリを見ているようで、 | ||
# GH Actionsでの ~ は /github/home/ に展開されるにもかかわらず | ||
# 実際のキャッシュは /root/ 以下に配備される。 | ||
# | ||
# /root/.ivy/cache, /root/.sbt - sbt関連のキャッシュ | ||
# /root/.m2 - ビルドログを観察した感じprotoc等はここを利用する | ||
# /root/.cache - cousierがscalasbt等をキャッシュするのに使っている | ||
path: | | ||
/root/.ivy2/cache | ||
/root/.sbt | ||
/root/.m2 | ||
/root/.cache | ||
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ env.cache-version }}-${{ github.ref }}-${{ hashFiles('**/build.sbt') }} | ||
restore-keys: | | ||
${{ runner.os }}-build-${{ env.cache-name }}-${{ env.cache-version }}-${{ github.ref }}- | ||
${{ runner.os }}-build-${{ env.cache-name }}-${{ env.cache-version }}- | ||
- name: Prepare build cache | ||
if: github.ref != 'refs/heads/master' | ||
uses: actions/cache@v3 | ||
env: | ||
cache-name: cache-build | ||
cache-version: v-5 | ||
with: | ||
path: | | ||
target | ||
project/target | ||
project/project/target | ||
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ env.cache-version }}-${{ github.ref }}-${{ github.sha }} | ||
restore-keys: | | ||
${{ runner.os }}-build-${{ env.cache-name }}-${{ env.cache-version }}-${{ github.ref }}- | ||
${{ runner.os }}-build-${{ env.cache-name }}-${{ env.cache-version }}- | ||
# CIでのcheckoutはファイルのタイムスタンプをチェックアウト時刻に設定するため、 | ||
# そのままビルドするとlocalDependenciesにあるjarに変更が行われたと見なされ | ||
# 不要なインクリメンタルコンパイルが走る | ||
# タイムスタンプをコミット時刻に設定することでこれが回避できる | ||
- name: Restore localDependencies' timestamps | ||
# 参考: https://qiita.com/tomlla/items/219cea9dd071c8a9e147 | ||
run: | | ||
git config --global --add safe.directory /__w/SeichiAssist/SeichiAssist | ||
for jar in localDependencies/*.jar; do | ||
timestamp=`git log -1 --pretty=format:'%cd' --date=format:'%Y%m%d%H%M.%S' $jar` | ||
touch -t "$timestamp" $jar | ||
done | ||
# scalapbは.protoの再コンパイルの必要性を判定する際にタイムスタンプを見ているから、コミット時刻に合わせる | ||
- name: Restore protocol timestamps | ||
## 参考: https://qiita.com/tomlla/items/219cea9dd071c8a9e147 | ||
run: | | ||
for proto in protocol/*.proto; do | ||
timestamp=`git log -1 --pretty=format:'%cd' --date=format:'%Y%m%d%H%M.%S' $proto` | ||
touch -t "$timestamp" $proto | ||
done | ||
- name: Check format with Scalafmt | ||
run: ./sbt scalafmtCheckAll | ||
|
||
- name: Check lint with Scalafix on push | ||
run: ./sbt "scalafix --check" | ||
|
||
- name: Test and build artifact | ||
run: ./sbt assembly | ||
|
||
- name: Clean build artifact for caching target folder | ||
run: rm -r target/build |
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,104 @@ | ||
name: Create 1.18 release | ||
|
||
on: | ||
workflow_dispatch: | ||
|
||
jobs: | ||
get_version: | ||
runs-on: ubuntu-20.04 | ||
outputs: | ||
value: ${{ steps.version.outputs.version }} | ||
steps: | ||
- name: Output release version | ||
id: version | ||
run: echo "version=${{ github.run_number }}" >> "$GITHUB_OUTPUT" | ||
|
||
create_release: | ||
runs-on: ubuntu-20.04 | ||
container: ghcr.io/giganticminecraft/seichiassist-builder-v2:424c09f | ||
needs: [get_version] | ||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v3 | ||
with: | ||
submodules: 'recursive' | ||
|
||
- name: Prepare build dependencies cache | ||
uses: actions/cache@v3 | ||
env: | ||
cache-name: cache-build-dependencies | ||
cache-version: v-5 | ||
with: | ||
# sbt等は$HOMEではなくユーザーディレクトリを見ているようで、 | ||
# GH Actionsでの ~ は /github/home/ に展開されるにもかかわらず | ||
# 実際のキャッシュは /root/ 以下に配備される。 | ||
# | ||
# /root/.ivy/cache, /root/.sbt - sbt関連のキャッシュ | ||
# /root/.m2 - ビルドログを観察した感じprotoc等はここを利用する | ||
# /root/.cache - cousierがscalasbt等をキャッシュするのに使っている | ||
path: | | ||
/root/.ivy2/cache | ||
/root/.sbt | ||
/root/.m2 | ||
/root/.cache | ||
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ env.cache-version }}-${{ github.ref }}-${{ hashFiles('**/build.sbt') }} | ||
restore-keys: | | ||
${{ runner.os }}-build-${{ env.cache-name }}-${{ env.cache-version }}-${{ github.ref }}- | ||
${{ runner.os }}-build-${{ env.cache-name }}-${{ env.cache-version }}- | ||
- name: Prepare build cache | ||
if: github.ref != 'refs/heads/master' | ||
uses: actions/cache@v3 | ||
env: | ||
cache-name: cache-build | ||
cache-version: v-5 | ||
with: | ||
path: | | ||
target | ||
project/target | ||
project/project/target | ||
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ env.cache-version }}-${{ github.ref }}-${{ github.sha }} | ||
restore-keys: | | ||
${{ runner.os }}-build-${{ env.cache-name }}-${{ env.cache-version }}-${{ github.ref }}- | ||
${{ runner.os }}-build-${{ env.cache-name }}-${{ env.cache-version }}- | ||
# CIでのcheckoutはファイルのタイムスタンプをチェックアウト時刻に設定するため、 | ||
# そのままビルドするとlocalDependenciesにあるjarに変更が行われたと見なされ | ||
# 不要なインクリメンタルコンパイルが走る | ||
# タイムスタンプをコミット時刻に設定することでこれが回避できる | ||
- name: Restore localDependencies' timestamps | ||
# 参考: https://qiita.com/tomlla/items/219cea9dd071c8a9e147 | ||
run: | | ||
git config --global --add safe.directory /__w/SeichiAssist/SeichiAssist | ||
for jar in localDependencies/*.jar; do | ||
timestamp=`git log -1 --pretty=format:'%cd' --date=format:'%Y%m%d%H%M.%S' $jar` | ||
touch -t "$timestamp" $jar | ||
done | ||
# scalapbは.protoの再コンパイルの必要性を判定する際にタイムスタンプを見ているから、コミット時刻に合わせる | ||
- name: Restore protocol timestamps | ||
## 参考: https://qiita.com/tomlla/items/219cea9dd071c8a9e147 | ||
run: | | ||
for proto in protocol/*.proto; do | ||
timestamp=`git log -1 --pretty=format:'%cd' --date=format:'%Y%m%d%H%M.%S' $proto` | ||
touch -t "$timestamp" $proto | ||
done | ||
- name: Build artifact | ||
run: ./sbt assembly | ||
|
||
- name: Rename artifact | ||
run: | | ||
mv target/build/SeichiAssist.jar target/build/SeichiAssist-for-1.18-v${{ needs.get_version.outputs.value }}.jar | ||
- name: Create release | ||
uses: softprops/action-gh-release@v1 | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
with: | ||
files: target/build/SeichiAssist-for-1.18-v${{ needs.get_version.outputs.value }}.jar | ||
tag_name: "v${{ needs.get_version.outputs.value }}-for-1.18" | ||
draft: false | ||
|
||
- name: Clean build artifact for caching target folder | ||
run: rm -r target/build |
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 @@ | ||
17.0 |
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.