forked from Anuken/Mindustry
-
Notifications
You must be signed in to change notification settings - Fork 3
49 lines (39 loc) · 1.38 KB
/
push.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
name: Tests, BE
on: [push, workflow_dispatch]
permissions: {}
jobs:
runPush:
permissions:
contents: write # for Update bundles
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up JDK Temurin 8
uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: '8'
- name: Setup Gradle
uses: gradle/actions/setup-gradle@v4
- name: Update bundles
if: ${{ github.repository == 'acemany/MindustryV4' }}
run: |
./gradlew updateBundles
if [ -n "$(git status --porcelain)" ]; then
git config --global user.name "Github Actions"
git config --global user.email "[email protected]"
git add core/assets/bundles/*
git commit -m "Automatic bundle update"
git push
fi
- name: Run unit tests
run: ./gradlew tests:test --rerun-tasks --stacktrace
- name: Trigger BE build
if: ${{ github.repository == 'acemany/MindustryV4' }}
run: |
git clone --depth=1 --branch=master https://github.com/acemany/MindustryV4Builds ../MindustryV4Builds
cd ../MindustryV4Builds
BNUM=$(($GITHUB_RUN_NUMBER - 14))
git tag ${BNUM}
git config --global user.name "Github Actions"
git push https://acemany:${{ secrets.API_TOKEN_GITHUB }}@github.com/acemany/MindustryV4Builds ${BNUM}