-
Notifications
You must be signed in to change notification settings - Fork 9
169 lines (142 loc) · 4.36 KB
/
manual-build.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
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
name: Manual Build and Changelog
on:
workflow_dispatch:
jobs:
vars:
name: Gather Variables
runs-on: ubuntu-20.04
outputs:
release_type: ${{steps.cf_release_type.outputs.value }}
cf_project: ${{steps.cf_project.outputs.value }}
mod_id: ${{steps.mod_id.outputs.value }}
version: ${{steps.version.outputs.version }}
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Unshallow
run: git fetch --prune --unshallow
- name: Release Type
id: cf_release_type
uses: christian-draeger/[email protected]
with:
path: './gradle.properties'
property: 'cf_release_type'
- name: Project ID
id: cf_project
uses: christian-draeger/[email protected]
with:
path: './gradle.properties'
property: 'cf_project'
- name: Mod ID
id: mod_id
uses: christian-draeger/[email protected]
with:
path: './gradle.properties'
property: 'mod_id'
- name: Find Current Tag
id: current
uses: jimschubert/query-tag-action@v1
with:
include: 'v*'
exclude: '*-rc*'
commit-ish: '@'
skip-unshallow: 'true'
- name: Semver Version
id: version
run: |
version=$(echo "${{steps.current.outputs.tag}}" | cut -dv -f2)
echo "::set-output name=version::$version"
changelog:
name: Generate Changelog (tags)
runs-on: ubuntu-20.04
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Unshallow
run: git fetch --prune --unshallow
- name: Find Current Tag
id: current
uses: jimschubert/query-tag-action@v1
with:
include: 'v*'
exclude: '*-rc*'
commit-ish: '@'
skip-unshallow: 'true'
- name: Previous Tag
id: last
uses: jimschubert/query-tag-action@v1
with:
include: 'v*'
exclude: ${{steps.current.outputs.tag}}
skip-unshallow: 'true'
- name: Generate changelog
uses: jimschubert/beast-changelog-action@v1
with:
GITHUB_TOKEN: ${{github.token}}
CONFIG_LOCATION: .github/changelog.json
FROM: ${{steps.last.outputs.tag}}
TO: ${{steps.current.outputs.tag}}
OUTPUT: .github/CHANGELOG.md
- name: Read CHANGELOG file
id: getchangelog
run: echo "::set-output name=changelog::$(cat .github/CHANGELOG.md)"
- name: View Changelog
run: cat .github/CHANGELOG.md
- name: Add Artifact
uses: actions/upload-artifact@v2
with:
name: out
path: .github/CHANGELOG.md
jar:
name: Create JAR
runs-on: ubuntu-20.04
needs: [vars, changelog]
steps:
- name: Download Changelog Results
uses: actions/download-artifact@v2
with:
name: out
path: changelog
- name: Checkout
uses: actions/checkout@v2
- name: Unshallow
run: git fetch --prune --unshallow
- name: Set up JDK
uses: actions/setup-java@v2
with:
distribution: 'temurin'
java-version: "17"
- name: Grant execute permission for gradlew
run: chmod +x gradlew
- name: Data-generated assets
run: ./gradlew runData
env:
CM_RELEASE: true
GITHUB_ACTOR: ${{ secrets.GITHUB_ACTOR }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Build JAR with Gradle
run: ./gradlew build
env:
CM_RELEASE: true
GITHUB_ACTOR: ${{ secrets.GITHUB_ACTOR }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Output Dir Structure
run: ls -lhR build-out
- name: Add Artifact
uses: actions/upload-artifact@v2
with:
name: libs
path: |
build-out/${{ needs.vars.outputs.mod_id }}-${{ needs.vars.outputs.version }}.jar
build-out/${{ needs.vars.outputs.mod_id }}-${{ needs.vars.outputs.version }}-api.jar
view:
name: View Changelog Output
runs-on: ubuntu-20.04
needs: [changelog]
steps:
- name: Download Build Results
uses: actions/download-artifact@v2
with:
name: out
path: changelog
- run: cat changelog/CHANGELOG.md