-
Notifications
You must be signed in to change notification settings - Fork 5
105 lines (91 loc) · 4.37 KB
/
publish_project.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
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
# Publishes the project to GitHub Releases, CurseForge, and Modrinth
name: Publish Project
on:
push:
tags:
- "v[0-9]+.[0-9]+.[0-9]+" # any SemVer tag, e.g. v1.2.3
env:
# link to the changelog with a format code for the version
CHANGELOG_LOCATION: "Changelog is available [here](https://github.com/${{ github.repository }}/releases/tag/${{ github.ref_name }})"
# type of release
RELEASE_TYPE: "beta"
concurrency:
group: publish-${{ github.head_ref || github.ref }}
cancel-in-progress: true
jobs:
publish:
name: Publish
runs-on: ubuntu-latest
permissions:
contents: write # needed to create GitHub releases
steps:
- name: Checkout Repository
uses: actions/checkout@v4
- name: Set up JDK 17
uses: actions/setup-java@v1
with:
java-version: 17
- name: Grant execute permission for gradlew
run: chmod +x gradlew
- name: Cache Gradle packages
uses: actions/cache@v1
with:
path: ~/.gradle/caches
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle') }}
restore-keys: ${{ runner.os }}-gradle
- name: Build Project
run: ./gradlew build --warning-mode all --build-cache
- name: Publish to GitHub
uses: softprops/action-gh-release@v2
with:
files: |
"forge/build/libs/betterp2p-${{ steps.build.outputs.version }}-forge.jar"
"fabric/build/libs/betterp2p-${{ steps.build.outputs.version }}-fabric.jar"
generate_release_notes: true
fail_on_unmatched_files: true
- name: "Upload Forge to CurseForge"
uses: itsmeow/curseforge-upload@v3
with:
file_path: "forge/build/libs/betterp2p-${{ steps.build.outputs.version }}-forge.jar"
game_endpoint: "minecraft"
relations: "applied-energistics-2:requiredDependency,architectury-api:requiredDependency,kotlin-for-forge:requiredDependency"
game_versions: "Minecraft 1.20.1,Java 17,Forge"
project_id: "538092"
token: "${{ secrets.CF_API_TOKEN }}"
- name: "Upload Fabric to CurseForge"
uses: itsmeow/curseforge-upload@v3
with:
file_path: "fabric/build/libs/betterp2p-${{ steps.build.outputs.version }}-fabric.jar"
game_endpoint: "minecraft"
relations: "fabric-api:requiredDependency,applied-energistics-2:requiredDependency,fabric-language-kotlin:requiredDependency,architectury-api:requiredDependency"
game_versions: "Minecraft 1.20.1,Java 17,Fabric"
project_id: "538092"
token: "${{ secrets.CF_API_TOKEN }}"
- name: "Upload Forge to Modrinth"
uses: dsx137/modrinth-release-action@main
env:
MODRINTH_TOKEN: "${{ secrets.MODRINTH_TOKEN }}"
with:
name: "[Forge 1.20.1] v${{ steps.build.outputs.version }}"
project_id: 9DDxOvTJ
loaders: forge
game_versions: 1.20.1
version_number: "${{ steps.build.outputs.version }}"
files: |
"forge/build/libs/betterp2p-${{ steps.build.outputs.version }}-forge.jar"
dependencies: "lhGA9TYQ:required, ordsPcFz:required, XxWD5pD3:required"
version_type: release
- name: "Upload Fabric to Modrinth"
uses: dsx137/modrinth-release-action@main
env:
MODRINTH_TOKEN: "${{ secrets.MODRINTH_TOKEN }}"
with:
name: "[Fabric 1.20.1] v${{ steps.build.outputs.version }}"
project_id: 9DDxOvTJ
loaders: fabric
game_versions: 1.20.1
version_number: "${{ steps.build.outputs.version }}"
files: |
"fabric/build/libs/betterp2p-${{ steps.build.outputs.version }}-fabric.jar"
dependencies: "P7dR8mSH:required, XxWD5pD3:required, Ha28R6CL:required, lhGA9TYQ:required"
version_type: release