This repository has been archived by the owner on Aug 8, 2024. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 90
165 lines (141 loc) · 4.74 KB
/
pre-release.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
name: Publish Pre Release
on:
push:
branches:
- development
jobs:
changelog:
name: Generate Changelog
runs-on: ubuntu-latest
outputs:
tag: ${{ steps.changelog.outputs.tag }}
skipped: ${{ steps.changelog.outputs.skipped }}
clean_changelog: ${{ steps.changelog.outputs.clean_changelog }}
changelog: ${{ steps.changelog.outputs.changelog }}
build_number: ${{ steps.extract.outputs.build_number }}
release_id: ${{ steps.release.outputs.id }}
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
token: ${{ secrets.PRIVATE_TOKEN }}
- uses: actions/setup-node@v3
with:
node-version: 16
- run: npm install conventional-changelog-conventionalcommits
- name: Create changelog
id: changelog
uses: TriPSs/[email protected]
with:
github-token: ${{ secrets.PRIVATE_TOKEN }}
git-user-name: 'Wynntils'
git-user-email: '[email protected]'
pre-commit: ./.github/.pre-commit.js
config-file-path: ./.github/.config.js
skip-version-file: true
skip-git-pull: true
pre-release: true
pre-release-identifier: beta
- name: Create release
if: ${{ steps.changelog.outputs.skipped != 'true' }}
id: release
uses: softprops/action-gh-release@v1
with:
tag_name: ${{ steps.changelog.outputs.tag }}
body: ${{ steps.changelog.outputs.changelog }}
draft: true
prerelease: true
- name: Extract build information
id: extract
run: "echo build_number=`echo ${{ steps.changelog.outputs.tag }} | cut -d'.' -f4` >> $GITHUB_OUTPUT"
- name: Upload version information
uses: actions/upload-artifact@v3
with:
name: build
path: build.gradle
build:
name: Build
needs: [changelog] # Build needs the new version number
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/download-artifact@v3 # Download version information from changelog
with:
name: build
- name: Set up JDK 8
uses: actions/setup-java@v3
with:
distribution: "temurin"
java-version: 8
cache: "gradle"
- name: Build
env:
BUILD_NUMBER: ${{ needs.changelog.outputs.build_number }}
run: ./gradlew build
- name: Upload build
uses: actions/upload-artifact@v3
with:
name: build
path: build/libs
artifact:
name: Rename Artifact
needs: [build, changelog]
if: ${{ needs.changelog.outputs.skipped == 'false' }}
runs-on: ubuntu-latest
steps:
- uses: actions/download-artifact@v3
with:
name: build
path: build/libs
- name: Rename artifact
run: mv build/libs/wynntils-*.jar build/Wynntils-MC1.12.2-${{ needs.changelog.outputs.tag }}.jar
- name: Upload files to release
uses: softprops/action-gh-release@v1
if: ${{ needs.changelog.outputs.skipped != 'true' }}
with:
tag_name: ${{ needs.changelog.outputs.tag }}
draft: true
prerelease: true
files: build/Wynntils-MC1.12.2-${{ needs.changelog.outputs.tag }}.jar
- name: Upload renamed artifact
uses: actions/upload-artifact@v3
with:
name: build
path: build/Wynntils-MC1.12.2-${{ needs.changelog.outputs.tag }}.jar
release:
name: Release
runs-on: ubuntu-latest
needs: [artifact, changelog]
steps:
- uses: actions/download-artifact@v3
with:
name: build
- uses: Kir-Antipov/[email protected]
with:
modrinth-id: dU5Gb9Ab
modrinth-featured: true
modrinth-unfeature-mode: subset
modrinth-token: ${{ secrets.MODRINTH_API_TOKEN }}
curseforge-id: 303451
curseforge-token: ${{ secrets.CF_API_TOKEN }}
files-primary: Wynntils-MC1.12.2-${{ needs.changelog.outputs.tag }}.jar
files-secondary: ""
name: Wynntils ${{ needs.changelog.outputs.tag }}
version: ${{ needs.changelog.outputs.tag }}
version-type: beta
changelog: ${{ needs.changelog.outputs.changelog }}
loaders: forge
game-versions: 1.12.2
java: 8
release-gh:
name: Release Github
if: ${{ needs.changelog.outputs.skipped != 'true' }}
runs-on: ubuntu-latest
needs: [build, changelog, artifact]
steps:
- name: Publish Release
uses: eregon/publish-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
release_id: ${{ needs.changelog.outputs.release_id }}