1+ name : Release Curseforge Alpha Build
2+
3+ env :
4+ GH_PKG_URL : " https://maven.pkg.github.com/${{ github.repository }}"
5+
6+ on :
7+ workflow_dispatch :
8+ inputs :
9+ diagnostic_mode :
10+ description : Diagnostic Mode
11+ type : boolean
12+ default : false
13+ required : true
14+
15+ push :
16+ branches :
17+ - ' **'
18+ tags-ignore :
19+ - v*
20+ paths-ignore :
21+ - " README.md"
22+ - " LICENSE"
23+ - " .github/**/*"
24+
25+ jobs :
26+ vars :
27+ name : Get Variables
28+ runs-on : ubuntu-22.04
29+ outputs :
30+ version : ${{steps.version.outputs.version}}
31+ build : ${{steps.version.outputs.increment}}
32+ cf_project : ${{steps.gradle_props.outputs.cf_project}}
33+ mcVersion : ${{steps.gradle_props.outputs.minecraft_version}}
34+ forgeVersion : ${{steps.gradle_props.outputs.forge_version}}
35+
36+ steps :
37+ - name : Checkout
38+ uses : actions/checkout@v3
39+ with :
40+ fetch-depth : 0
41+
42+ - name : Version
43+ id : version
44+ 45+ with :
46+ change_path : " forge-api/ forge-main/"
47+ version_format : " ${major}.${minor}.${patch}"
48+ search_commit_body : true
49+
50+ - name : Read MC and Forge versions
51+ id : gradle_props
52+ uses :
christian-draeger/[email protected] 53+ with :
54+ path : " gradle.properties"
55+ properties : " minecraft_version forge_version cf_project"
56+
57+ get-package-info :
58+ name : Get Latest Package Info
59+ runs-on : ubuntu-22.04
60+ needs : [ publish-gh-package ]
61+ outputs :
62+ version : ${{ steps.download-info.outputs.version }}
63+ steps :
64+ - name : Download Package Info
65+ id : download-info
66+ uses :
compactmods/[email protected] 67+ env :
68+ GQL_TOKEN : ${{ secrets.GITHUB_TOKEN }}
69+ with :
70+ owner : compactmods
71+ repo : compactcrafting
72+ group : dev.compactmods.compactcrafting
73+ filter : " ^compactcrafting-(?:[\\ d\\ .]+)-nightly.jar$"
74+ outputFile : compactcrafting-nightly.json
75+
76+ - name : Debug output
77+ run : |
78+ echo "Version: ${{ steps.download-info.outputs.version }}"
79+ cat compactcrafting-nightly.json
80+ - name : Read info into variable [latest]
81+ id : info
82+ run : echo "latestJson=$(cat compactcrafting-nightly.json)" >> $GITHUB_OUTPUT
83+
84+ - name : Download JAR and prepare artifacts
85+ run : |
86+ mkdir release
87+ curl -L "${{ fromJson(steps.info.outputs.latestJson)[0].url }}" -o "release/${{ fromJson(steps.info.outputs.latestJson)[0].name}}"
88+ mv compactcrafting-nightly.json release/compactcrafting-nightly.json
89+
90+ - name : Add Artifact
91+ uses : actions/upload-artifact@v3
92+ with :
93+ name : release
94+ path : release
95+
96+ release :
97+ name : Release
98+ needs : [ vars, get-package-info ]
99+ runs-on : ubuntu-22.04
100+ steps :
101+ - name : Grab JAR and Info
102+ uses : actions/download-artifact@v3
103+ with :
104+ name : release
105+ path : .
106+
107+ - name : Read info into variable [latest]
108+ id : info
109+ run : echo "latestJson=$(cat compactcrafting-nightly.json)" >> $GITHUB_OUTPUT
110+
111+ - name : Create CurseForge Release
112+ uses : itsmeow/curseforge-upload@master
113+ with :
114+ token : ${{ secrets.CF_API_TOKEN }}
115+ project_id : ${{ needs.vars.outputs.cf_project }}
116+ game_endpoint : minecraft
117+ file_path : ${{ fromJson(steps.info.outputs.latestJson)[0].name}}
118+ changelog : " This is a nightly build. It is not production-modpack ready and no support will be provided; it is intended for early testing and feedback."
119+ changelog_type : markdown
120+ game_versions : java:Java 17,Forge
121+ release_type : alpha
0 commit comments