forked from Anuken/Mindustry
-
Notifications
You must be signed in to change notification settings - Fork 0
59 lines (54 loc) · 1.89 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
50
51
52
53
54
55
56
57
58
59
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 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 "[email protected]"
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 "${GITHUB_SHA}"
git push https://Anuken:${{ secrets.API_TOKEN_GITHUB }}@github.com/Anuken/MindustryJitpack
cd ../Mindustry
- name: Run unit tests
run: ./gradlew clean cleanTest test --stacktrace