forked from micdoodle8/Galacticraft
-
Notifications
You must be signed in to change notification settings - Fork 32
78 lines (67 loc) · 2.04 KB
/
ci.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
name: 'CI'
on:
push:
branches: [ "master-1.12" ]
jobs:
build:
env:
VERSION_SUFFIX: -SNAPSHOT
name: Build
runs-on: ubuntu-latest
if: ${{!startsWith(github.event.head_commit.message, 'ci')}}
steps:
- if: startsWith(github.ref, 'refs/tags/')
id: set_suffix_if_tagged
run: |
echo "VERSION_SUFFIX=" >> $GITHUB_ENV
- uses: actions/checkout@v3
- name: Cache
uses: actions/[email protected]
with:
path: |
~/.m2
~/.gradle
key: ${{ runner.os }}-gradle-${{ hashFiles('build.gradle') }}
- name: Validate Gradle wrapper
uses: gradle/wrapper-validation-action@v1
- uses: actions/setup-java@v3
with:
distribution: temurin
java-version: 17
- name: Decode Keystore
id: decode
uses: timheuer/[email protected]
with:
fileName: 'keyring.gpg'
encodedString: ${{ secrets.SIGNING_SECRET_KEY_RING_FILE }}
- name: Expose
run: cp ${{ steps.decode.outputs.filePath }} .
- uses: gradle/gradle-build-action@v2
if: ${{ !startsWith(github.ref, 'refs/tags/') }}
with:
arguments: build
- uses: gradle/gradle-build-action@v2
if: startsWith(github.ref, 'refs/tags/')
with:
arguments: build createChangelog
- name: Create Release
id: release
uses: softprops/[email protected]
if: startsWith(github.ref, 'refs/tags/')
with:
body_path: ${{ github.workspace }}/changelog/*.md
- name: Publish Release
uses: gradle/gradle-build-action@v2
if: steps.release.outcome == 'success'
env:
CURSE_TOKEN: ${{ secrets.CURSE_TOKEN }}
MODRINTH_TOKEN: ${{ secrets.MODRINTH_TOKEN }}
with:
arguments: pubishToAll
- name: 'Deploy to Nexus'
uses: gradle/gradle-build-action@v2
env:
NEXUS_USER: ${{ secrets.NEXUS_USER }}
NEXUS_PASSWORD: ${{ secrets.NEXUS_PASSWORD }}
with:
arguments: publishToGalacticMaven -Pversion_suffix=${{ env.VERSION_SUFFIX }}