Fri Oct 6 11:04:11 UTC 2023: trigger new build(s) #86
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
name: 'TeaCon 2023 | Crock Pot | S2White' | |
on: | |
push: | |
paths: | |
- '.github/workflows/mod-team-crockpot.yaml' | |
- 'mods/team-crockpot/HEAD' | |
workflow_dispatch: | |
jobs: | |
publish: | |
name: 'Build Crock Pot' | |
environment: Build | |
runs-on: ubuntu-22.04 | |
steps: | |
- name: Checkout Build Environment | |
uses: actions/checkout@v3 | |
- name: Setup JDK 17 | |
uses: actions/setup-java@v3 | |
with: | |
distribution: 'temurin' | |
java-version: '17' | |
- name: Apply Cache | |
uses: actions/cache@v3 | |
with: | |
path: | | |
~/.gradle/caches | |
~/.gradle/wrapper | |
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*') }} | |
restore-keys: | |
${{ runner.os }}-gradle- | |
# We cannot use action/checkout@v2 because it does not support non-GitHub repositroy. | |
# The clone logic used here is adapted from https://stackoverflow.com/a/3489576 for | |
# sake of a faster build. | |
- name: 'Checkout Repository for Build Crock Pot' | |
shell: bash | |
run: | | |
mkdir -p build/repo | |
cd build/repo | |
git init | |
git remote add origin `cat ../../mods/team-crockpot/remote` | |
git fetch --depth=1 origin `cat ../../mods/team-crockpot/HEAD` | |
git reset --hard `cat ../../mods/team-crockpot/HEAD` | |
git submodule init | |
git submodule update | |
[ -f build.gradle ] || [ -f build.gradle.kts ] || { echo '::error::Git 仓库检出疑似失败,请检查碧螺春中分支名是否正确!'; exit 1; } | |
- name: Validate Gradle Wrapper | |
id: gradle_wrapper_check | |
continue-on-error: true | |
uses: gradle/wrapper-validation-action@v1 | |
with: | |
min-wrapper-count: 1 | |
- name: Artifact Building | |
id: building | |
shell: bash | |
env: | |
BILUOCHUN_URL: https://biluochun.teacon.cn | |
TEAM_ID: 239 | |
GRADLE_WRAPPER_CHECK: ${{ steps.gradle_wrapper_check.outcome == 'success' }} | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
run: cd build && ./build.sh | |
# We need at least Python 3.11 to ensure existence of tomllib (see PEP 680) | |
- name: Setup Python | |
uses: actions/setup-python@v4 | |
with: | |
python-version: '3.11' | |
- name: Mod Description File Validation | |
id: description | |
shell: bash | |
env: | |
TEAM_ID: crockpot | |
run: ./build/mods_toml.py | |
- name: Prepare for Dedicated Server Launching Test | |
id: dedicated_server_launching_setup | |
shell: bash | |
run: cd build && ./pre-server-test.sh | |
- name: Dedicated Server Launching Test | |
id: dedicated_server_launching | |
uses: teaconmc/[email protected] | |
with: | |
extra: build/all-deps.json | |
mod: ${{ steps.building.outputs.artifact }} | |
- name: Publish | |
id: publication | |
shell: bash | |
env: | |
BILUOCHUN_URL: https://biluochun.teacon.cn | |
CONTEST_ID: 2023 | |
TEAM_ID: 'crockpot' | |
TEAM_SEQ: '239' | |
BILUOCHUN_TOKEN: ${{ secrets.BILUOCHUN_TOKEN }} | |
S3_ENDPOINT: ${{ secrets.S3_ENDPOINT }} | |
AWS_ACCESS_KEY_ID: ${{ secrets.S3_ACCESS_KEY }} | |
AWS_SECRET_ACCESS_KEY: ${{ secrets.S3_SECRET_KEY }} | |
# https://github.com/aws/aws-cli/issues/5623 | |
AWS_EC2_METADATA_DISABLED: 'true' | |
run: cd build && ./publish.sh | |
- name: Failure notification | |
id: failure_notification | |
if: failure() | |
shell: bash | |
env: | |
BILUOCHUN_URL: https://biluochun.teacon.cn | |
BILUOCHUN_TOKEN: ${{ secrets.BILUOCHUN_TOKEN }} | |
TEAM_ID: 'crockpot' | |
TEAM_SEQ: '239' | |
run: cd build && ./failure-callback.sh | |
# Change this counter to trigger all mod rebuild |