BuildWeapon fixe (#10339) #5445
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: Tests | |
on: [push, workflow_dispatch] | |
permissions: {} | |
jobs: | |
runPush: | |
permissions: | |
contents: write # for Update bundles | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Trigger BE build | |
if: ${{ github.repository == 'Anuken/Mindustry' }} | |
run: | | |
git clone --depth=1 --branch=master https://github.com/Anuken/MindustryBuilds ../MindustryBuilds | |
cd ../MindustryBuilds | |
BNUM=$(($GITHUB_RUN_NUMBER + 20000)) | |
git tag ${BNUM} | |
git config --global user.name "Github Actions" | |
git push https://Anuken:${{ secrets.API_TOKEN_GITHUB }}@github.com/Anuken/MindustryBuilds ${BNUM} | |
- name: Set up JDK 17 | |
uses: actions/setup-java@v1 | |
with: | |
java-version: 17 | |
- name: Setup Gradle | |
uses: gradle/gradle-build-action@v2 | |
- name: Update bundles | |
if: ${{ github.repository == 'Anuken/Mindustry' }} | |
run: | | |
./gradlew updateBundles | |
if [ -n "$(git status --porcelain)" ]; then | |
git config --global user.name "Github Actions" | |
git config --global user.email "actions@github.com" | |
git add core/assets/bundles/* | |
git commit -m "Automatic bundle update" | |
git push | |
fi | |
- name: Update JITpack repo | |
if: ${{ github.repository == 'Anuken/Mindustry' }} | |
run: | | |
git config --global user.name "Github Actions" | |
git config --global user.email "actions@github.com" | |
cd ../ | |
cp -r ./Mindustry ./MindustryJitpack | |
cd MindustryJitpack | |
git clone --depth 1 https://github.com/Anuken/MindustryJitpack.git | |
rm -rf .git | |
cp -r ./MindustryJitpack/.git ./.git | |
rm -rf MindustryJitpack | |
rm -rf .github | |
rm README.md | |
git add . | |
git commit --allow-empty -m "Updating" | |
git push https://Anuken:${{ secrets.API_TOKEN_GITHUB }}@github.com/Anuken/MindustryJitpack | |
cd ../Mindustry | |
- name: Run unit tests | |
run: ./gradlew tests:test --rerun --stacktrace |