Mindustry/.github/workflows/push.yml

54 lines
1.7 KiB
YAML
Raw Normal View History

2020-11-20 06:54:28 +07:00
name: Tests
2020-11-20 06:53:02 +07:00
2020-11-26 04:09:17 +07:00
on: [push, workflow_dispatch]
2020-11-20 06:53:02 +07:00
jobs:
2021-06-14 22:05:37 +07:00
runPush:
2020-11-20 06:53:02 +07:00
runs-on: ubuntu-latest
steps:
2020-11-20 07:27:21 +07:00
- uses: actions/checkout@v2
2020-11-20 06:53:02 +07:00
- name: Trigger BE build
2020-11-25 23:56:10 +07:00
if: ${{ github.repository == 'Anuken/Mindustry' }}
2020-11-20 06:53:02 +07:00
run: |
git clone --depth=1 --branch=master https://github.com/Anuken/MindustryBuilds ../MindustryBuilds
cd ../MindustryBuilds
2020-11-20 23:26:49 +07:00
BNUM=$(($GITHUB_RUN_NUMBER + 20000))
git tag ${BNUM}
2021-11-23 01:12:14 +07:00
git config --global user.name "Github Actions"
2020-11-20 23:26:49 +07:00
git push https://Anuken:${{ secrets.API_TOKEN_GITHUB }}@github.com/Anuken/MindustryBuilds ${BNUM}
2021-09-23 05:01:04 +07:00
- name: Set up JDK 17
2021-06-03 20:52:45 +07:00
uses: actions/setup-java@v1
with:
2021-09-23 05:01:04 +07:00
java-version: 17
2022-03-28 22:33:27 +07:00
- name: Setup Gradle
uses: gradle/gradle-build-action@v2
2021-11-22 23:52:08 +07:00
- name: Update bundles
if: ${{ github.repository == 'Anuken/Mindustry' }}
run: |
./gradlew updateBundles
2021-11-23 00:04:09 +07:00
2021-11-23 00:04:51 +07:00
if [ -n "$(git status --porcelain)" ]; then
2021-11-22 23:52:08 +07:00
git add core/assets/bundles/*
git commit -m "Automatic bundle update"
git push
fi
2022-05-11 07:28:09 +07:00
- name: Update JITpack repo
2022-06-08 19:25:04 +07:00
if: ${{ github.repository == 'Anuken/Mindustry' }}
2022-05-11 07:28:09 +07:00
run: |
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
2022-05-11 07:30:07 +07:00
rm -rf .github
2022-05-11 07:28:09 +07:00
rm README.md
git add .
2022-05-11 07:50:36 +07:00
git commit --allow-empty -m "${GITHUB_SHA}"
2022-05-11 07:28:09 +07:00
git push https://Anuken:${{ secrets.API_TOKEN_GITHUB }}@github.com/Anuken/MindustryJitpack
cd ../Mindustry
2021-06-03 20:52:45 +07:00
- name: Run unit tests
2021-09-23 05:17:54 +07:00
run: ./gradlew clean cleanTest test --stacktrace