generated from liplum/MindustryModTemplate
-
Notifications
You must be signed in to change notification settings - Fork 10
79 lines (67 loc) · 2.19 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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
name: Build Push Changes
on: push
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set Android SDK tools
run: echo "$ANDROID_HOME/build-tools/30.0.3" >> $GITHUB_PATH
- name: Set up JDK 17
uses: actions/setup-java@v2
with:
java-version: '17'
distribution: 'temurin'
cache: 'gradle'
- name: Get short commit hash
run: echo "SHORT_SHA=$(git rev-parse --short HEAD)" >> $GITHUB_ENV
- name: Build MultiCrafter
run: |
chmod +x gradlew
./gradlew :main:deploy
./gradlew distInjection
- uses: actions/upload-artifact@v2
with:
name: MultiCrafterMod
path: main/build/tmp/deploy/*.jar
- uses: actions/upload-artifact@v2
with:
name: MultiCrafterLibDist
path: build/tmp/distInjection/*.zip
upload:
needs: build
if: ${{ contains(github.event.head_commit.message,'[release]') }}
runs-on: ubuntu-latest
env:
GH_REPO: ${{ github.repository }}
steps:
- uses: actions/checkout@v2
- uses: actions/download-artifact@v2
with:
name: MultiCrafterMod
path: out
- uses: actions/download-artifact@v2
with:
name: MultiCrafterLibDist
path: out
- name: Retrieve meta
id: retrieveMeta
run: |
chmod +x gradlew
./gradlew retrieveMeta
- name: Create release
if: ${{ steps.retrieveMeta.outputs.tag_exist == 'false' }}
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
HEADER: ${{ steps.retrieveMeta.outputs.header }}
VERSION: ${{ steps.retrieveMeta.outputs.version }}
TAG_EXIST: ${{ steps.retrieveMeta.outputs.tag_exist }}
run: |
gh release create "$VERSION" --title "$HEADER" --notes-file "$GITHUB_WORKSPACE/.github/workflows/ReleaseMessage.md" out/*
- name: Update release file if possible
if: always()
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
VERSION: ${{ steps.retrieveMeta.outputs.version }}
run: |
gh release upload "$VERSION" out/* --clobber