-
Notifications
You must be signed in to change notification settings - Fork 10
88 lines (83 loc) · 3.8 KB
/
build-and-deploy.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
80
81
82
83
84
85
86
87
88
name: Build and Deploy
on:
push:
branches:
- '*/main'
jobs:
build-and-deploy:
env:
BRANCH_PREFIX: $(cat gradle.properties | grep mod_version | cut -d'+' -f2)
strategy:
matrix:
java: [
17,
]
runs-on: ubuntu-latest
steps:
- name: check environment variables
run: env
- name: checkout repository
uses: actions/checkout@v3
- name: validate gradle wrapper
uses: gradle/wrapper-validation-action@v1
- name: setup jdk ${{ matrix.java }}
uses: actions/setup-java@v3
with:
java-version: ${{ matrix.java }}
distribution: 'microsoft'
- name: make gradle wrapper executable
run: chmod +x ./gradlew
- name: build
if: github.ref == 'refs/heads/${{ env.BRANCH_PREFIX }}/main'
run: ./gradlew build
- name: capture build artifacts
if: |
${{ matrix.java == '17' }}
github.ref == 'refs/heads/${{ env.BRANCH_PREFIX }}/main'
uses: actions/upload-artifact@v3
with:
name: Artifacts
path: build/libs/
- name: get mod version
if: github.ref == 'refs/heads/${{ env.BRANCH_PREFIX }}/main'
id: mod_version
run: |
mod_version_val=$(grep "mod_version" gradle.properties | cut -d'=' -f2 | tr -d '\n')
echo "mod_version=$mod_version_val" >> $GITHUB_OUTPUT
- name: get minecraft version
if: github.ref == 'refs/heads/${{ env.BRANCH_PREFIX }}/main'
id: minecraft_version
run: |
minecraft_version_val=$(grep "mod_version" gradle.properties | cut -d'+' -f2 | tr -d '\n')
echo "minecraft_version=$minecraft_version_val" >> $GITHUB_OUTPUT
- name: deploy with mc-publish
if: github.ref == 'refs/heads/${{ env.BRANCH_PREFIX }}/main'
uses: Kir-Antipov/[email protected]
with:
curseforge-id: 409221
curseforge-token: ${{ secrets.CURSEFORGE_TOKEN }}
curseforge-dependencies: |
[email protected]+1.19.2(required){modrinth:P7dR8mSH}{curseforge:306612}#(ignore:github)
[email protected]+1.19.2(required){modrinth:wFyCClLQ}{curseforge:514734}#(ignore:github)
[email protected](required){modrinth:9s6osm5g}{curseforge:348521}#(ignore:github)
[email protected]+1.19-fabric(embedded){modrinth:AOyJhFvl}{curseforge:643780}#(ignore:github)
[email protected](embedded){modrinth:K01OU20C}{curseforge:318449}#(ignore:github)
modrinth-id: o5GUN4b1
modrinth-token: "${{ secrets.MODRINTH_TOKEN }}"
modrinth-dependencies: |
[email protected]+1.19.2(required){modrinth:P7dR8mSH}{curseforge:306612}#(ignore:github)
[email protected]+1.19.2(required){modrinth:wFyCClLQ}{curseforge:514734}#(ignore:github)
[email protected](required){modrinth:9s6osm5g}{curseforge:348521}#(ignore:github)
[email protected]+1.19-fabric(embedded){modrinth:AOyJhFvl}{curseforge:643780}#(ignore:github)
[email protected](embedded){modrinth:K01OU20C}{curseforge:318449}#(ignore:github)
[email protected](embedded){modrinth:kD9Vl1lR}#(ignore:curseforge)#(ignore:github)
# Modrinth has issues accepting javadocs right now
github-tag: "${{ steps.mod_version.outputs.mod_version }}"
github-token: ${{ secrets.REPOSITORY_TOKEN }}
github-commitish: ${{ steps.minecraft_version.outputs.minecraft_version }}/main
version: "${{ steps.mod_version.outputs.mod_version }}"
version-type: release
changelog-file: CHANGELOG.md
loaders: fabric
game-versions: "${{ steps.minecraft_version.outputs.minecraft_version }}"
java: "${{ matrix.java }}"