Skip to content

Commit b8385b3

Browse files
committed
[ci] Manual Build, Tagged Release updates
1 parent 2f4812c commit b8385b3

File tree

2 files changed

+86
-30
lines changed

2 files changed

+86
-30
lines changed

.github/workflows/manual-build.yml

Lines changed: 32 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -5,17 +5,21 @@ on:
55

66
jobs:
77
vars:
8-
name: Get Variables
8+
name: Gather Variables
99
runs-on: ubuntu-20.04
1010
outputs:
1111
release_type: ${{steps.cf_release_type.outputs.value }}
1212
cf_project: ${{steps.cf_project.outputs.value }}
13-
mod_version: ${{steps.mod_version.outputs.value }}
1413
mod_id: ${{steps.mod_id.outputs.value }}
14+
version: ${{steps.version.outputs.version }}
15+
1516
steps:
1617
- name: Checkout
1718
uses: actions/checkout@v2
1819

20+
- name: Unshallow
21+
run: git fetch --prune --unshallow
22+
1923
- name: Release Type
2024
id: cf_release_type
2125
uses: christian-draeger/[email protected]
@@ -30,20 +34,28 @@ jobs:
3034
path: './gradle.properties'
3135
property: 'cf_project'
3236

33-
- name: Mod Version
34-
id: mod_version
35-
uses: christian-draeger/[email protected]
36-
with:
37-
path: './gradle.properties'
38-
property: 'mod_version'
39-
4037
- name: Mod ID
4138
id: mod_id
4239
uses: christian-draeger/[email protected]
4340
with:
4441
path: './gradle.properties'
4542
property: 'mod_id'
4643

44+
- name: Find Current Tag
45+
id: current
46+
uses: jimschubert/query-tag-action@v1
47+
with:
48+
include: 'v*'
49+
exclude: '*-rc*'
50+
commit-ish: '@'
51+
skip-unshallow: 'true'
52+
53+
- name: Semver Version
54+
id: version
55+
run: |
56+
version=$(echo "${{steps.current.outputs.tag}}" | cut -dv -f2)
57+
echo "::set-output name=version::$version"
58+
4759
changelog:
4860
name: Generate Changelog (tags)
4961
runs-on: ubuntu-20.04
@@ -116,9 +128,17 @@ jobs:
116128
- name: Grant execute permission for gradlew
117129
run: chmod +x gradlew
118130

131+
- name: Data-generated assets
132+
run: ./gradlew runData
133+
env:
134+
CM_RELEASE: true
135+
GITHUB_ACTOR: ${{ secrets.GITHUB_ACTOR }}
136+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
137+
119138
- name: Build JAR with Gradle
120-
run: ./gradlew build --max-workers 1
139+
run: ./gradlew build
121140
env:
141+
CM_RELEASE: true
122142
GITHUB_ACTOR: ${{ secrets.GITHUB_ACTOR }}
123143
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
124144

@@ -130,8 +150,8 @@ jobs:
130150
with:
131151
name: libs
132152
path: |
133-
build-out/${{ needs.vars.outputs.mod_id }}-${{ needs.vars.outputs.mod_version }}.jar
134-
build-out/${{ needs.vars.outputs.mod_id }}-${{ needs.vars.outputs.mod_version }}-api.jar
153+
build-out/${{ needs.vars.outputs.mod_id }}-${{ needs.vars.outputs.version }}.jar
154+
build-out/${{ needs.vars.outputs.mod_id }}-${{ needs.vars.outputs.version }}-api.jar
135155
136156
view:
137157
name: View Changelog Output

.github/workflows/tagged-release.yml

Lines changed: 54 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -5,17 +5,21 @@ on: workflow_dispatch
55

66
jobs:
77
vars:
8-
name: Get Variables
8+
name: Gather Variables
99
runs-on: ubuntu-20.04
1010
outputs:
1111
release_type: ${{steps.cf_release_type.outputs.value }}
1212
cf_project: ${{steps.cf_project.outputs.value }}
13-
mod_version: ${{steps.mod_version.outputs.value }}
1413
mod_id: ${{steps.mod_id.outputs.value }}
14+
version: ${{steps.version.outputs.version }}
15+
1516
steps:
1617
- name: Checkout
1718
uses: actions/checkout@v2
1819

20+
- name: Unshallow
21+
run: git fetch --prune --unshallow
22+
1923
- name: Release Type
2024
id: cf_release_type
2125
uses: christian-draeger/[email protected]
@@ -30,20 +34,28 @@ jobs:
3034
path: './gradle.properties'
3135
property: 'cf_project'
3236

33-
- name: Mod Version
34-
id: mod_version
35-
uses: christian-draeger/[email protected]
36-
with:
37-
path: './gradle.properties'
38-
property: 'mod_version'
39-
4037
- name: Mod ID
4138
id: mod_id
4239
uses: christian-draeger/[email protected]
4340
with:
4441
path: './gradle.properties'
4542
property: 'mod_id'
4643

44+
- name: Find Current Tag
45+
id: current
46+
uses: jimschubert/query-tag-action@v1
47+
with:
48+
include: 'v*'
49+
exclude: '*-rc*'
50+
commit-ish: '@'
51+
skip-unshallow: 'true'
52+
53+
- name: Semver Version
54+
id: version
55+
run: |
56+
version=$(echo "${{steps.current.outputs.tag}}" | cut -dv -f2)
57+
echo "::set-output name=version::$version"
58+
4759
changelog:
4860
name: Generate Changelog (tags)
4961
runs-on: ubuntu-20.04
@@ -116,8 +128,25 @@ jobs:
116128
- name: Grant execute permission for gradlew
117129
run: chmod +x gradlew
118130

119-
- name: Publish package
120-
run: ./gradlew build -x test
131+
- name: Create datagen assets
132+
continue-on-error: true
133+
run: ./gradlew runData
134+
135+
- name: Test JAR with GameTest Server
136+
run: ./gradlew runGameTestServer
137+
env:
138+
GITHUB_ACTOR: ${{ secrets.GITHUB_ACTOR }}
139+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
140+
141+
- name: Upload build failure
142+
if: failure()
143+
uses: actions/upload-artifact@v3
144+
with:
145+
name: test-data
146+
path: run/gametest
147+
148+
- name: Build JAR
149+
run: ./gradlew build
121150
env:
122151
CM_RELEASE: true
123152
GITHUB_ACTOR: ${{ secrets.GITHUB_ACTOR }}
@@ -128,8 +157,8 @@ jobs:
128157
with:
129158
name: libs
130159
path: |
131-
build-out/${{ needs.vars.outputs.mod_id }}-${{ needs.vars.outputs.mod_version }}.jar
132-
build-out/${{ needs.vars.outputs.mod_id }}-${{ needs.vars.outputs.mod_version }}-api.jar
160+
build-out/${{ needs.vars.outputs.mod_id }}-${{ needs.vars.outputs.version }}.jar
161+
build-out/${{ needs.vars.outputs.mod_id }}-${{ needs.vars.outputs.version }}-api.jar
133162
134163
view:
135164
name: View Changelog Output
@@ -171,12 +200,12 @@ jobs:
171200
prerelease: false
172201
files: |
173202
changelog/CHANGELOG.md
174-
build-out/${{ needs.vars.outputs.mod_id }}-${{ needs.vars.outputs.mod_version }}.jar
175-
build-out/${{ needs.vars.outputs.mod_id }}-${{ needs.vars.outputs.mod_version }}-api.jar
203+
build-out/${{ needs.vars.outputs.mod_id }}-${{ needs.vars.outputs.version }}.jar
204+
build-out/${{ needs.vars.outputs.mod_id }}-${{ needs.vars.outputs.version }}-api.jar
176205
177206
- name: Full File
178207
id: filename
179-
run: echo "::set-output name=fullpath::build-out/${{ needs.vars.outputs.mod_id }}-${{ needs.vars.outputs.mod_version }}.jar"
208+
run: echo "::set-output name=fullpath::build-out/${{ needs.vars.outputs.mod_id }}-${{ needs.vars.outputs.version }}.jar"
180209

181210
- name: Create CurseForge Release
182211
uses: itsmeow/curseforge-upload@master
@@ -204,8 +233,15 @@ jobs:
204233
distribution: 'temurin'
205234
java-version: "17"
206235

207-
- name: Build JAR with Gradle
208-
run: ./gradlew build --max-workers 1
236+
- name: Grant execute permission for gradlew
237+
run: chmod +x gradlew
238+
239+
- name: Generate Resources
240+
run: ./gradlew runData
241+
242+
- name: Publish gradle nightly jar
243+
run: ./gradlew publishReleasePublicationToGitHubPackagesRepository
209244
env:
245+
CM_RELEASE: true
210246
GITHUB_ACTOR: ${{ secrets.GITHUB_ACTOR }}
211247
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

0 commit comments

Comments
 (0)