-
Notifications
You must be signed in to change notification settings - Fork 687
55 lines (51 loc) · 1.81 KB
/
build.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
name: 'Build and Test'
on:
push:
pull_request:
branches:
- '*'
# Cancel outdated builds for the same branch
concurrency:
group: ci-build-${{ github.ref }}
cancel-in-progress: true
jobs:
build:
# Only run the pull-request build if the pull-request was opened from another repository,
# since we already run this workflow for the branch the pull request was made from.
if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name != github.repository
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: ./.github/actions/gradle-setup
- name: Generate assets
run: ./gradlew runData
- name: Check that datagen ran
run: test -d ./src/generated/resources/.cache
- name: Make sure that datagenned files in the repo are up-to-date
run: |
# Print status for easier debugging
git status
if [ -n "$(git status --porcelain)" ]; then exit 1; fi
# Gradle Step for PRs
- name: Build PR with Gradle
run: ./gradlew build
env:
PR_NUMBER: ${{ github.event.pull_request.number }}
if: github.event_name == 'pull_request'
# Gradle Step for normal branch pushes
- name: Build PR with Gradle
run: ./gradlew build
if: github.event_name != 'pull_request'
#- name: Run Game Tests
# run: ./gradlew runGametest
- name: Upload new Source Text Strings to Crowdin
run: ./gradlew uploadToCrowdin
env:
GIT_BRANCH: master
CROWDIN_TOKEN: ${{ secrets.CROWDIN_TOKEN }}
continue-on-error: true
if: github.ref == 'refs/heads/master' && github.event_name != 'pull_request'
- uses: actions/upload-artifact@v3
with:
name: dist
path: build/libs/