-
Notifications
You must be signed in to change notification settings - Fork 8
163 lines (142 loc) · 4.82 KB
/
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
name: Publish Release
on:
push:
branches:
- release
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 }}
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
token: ${{ secrets.GITHUB_TOKEN }}
- uses: actions/setup-node@v4
with:
node-version: 16
- run: |
npm install [email protected]
npm install [email protected]
- name: Set up version.json
run: echo "{"version":$(git describe --tags --abbrev=0)}" > version.json
- name: Create changelog
id: changelog
uses: TriPSs/[email protected]
with:
github-token: ${{ secrets.PRIVATE_TOKEN }}
git-user-name: 'VoWBot'
git-user-email: '[email protected]'
pre-commit: ./.github/.pre-commit.js
config-file-path: ./.github/.config.js
version-file: ./version.json
skip-version-file: true
skip-git-pull: true
pre-release: false
release-count: 5
- name: Create release
if: ${{ steps.changelog.outputs.skipped != 'true' }}
id: release
uses: softprops/[email protected]
with:
tag_name: ${{ steps.changelog.outputs.tag }}
body: ${{ steps.changelog.outputs.clean_changelog }}
draft: true
prerelease: false
- name: Upload version information
uses: actions/upload-artifact@v4
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@v4
- uses: actions/download-artifact@v4 # Download version information from changelog
with:
name: build
- name: Set up JDK 21
uses: actions/setup-java@v4
with:
distribution: "temurin"
java-version: 21
cache: "gradle"
- name: Build with Gradle
uses: gradle/actions/setup-gradle@v3
with:
arguments: buildDependents -x spotlessCheck -x test
- name: Upload build
uses: actions/upload-artifact@v4
with:
name: build
path: |
**/build/libs/*-fabric+MC-*.jar
if-no-files-found: error
overwrite: true
release-github:
name: Release to Github
if: ${{ needs.changelog.outputs.skipped != 'true' }}
runs-on: ubuntu-latest
needs: [ build, changelog ]
steps:
- name: Download build
uses: actions/download-artifact@v4
with:
name: build
- name: Create release and upload files
if: ${{ needs.changelog.outputs.skipped != 'true' }}
id: release
uses: softprops/action-gh-release@v2
with:
tag_name: ${{ needs.changelog.outputs.tag }}
body: ${{ needs.changelog.outputs.changelog }}
draft: false
prerelease: false
files: |
**/build/libs/*-fabric+MC-*.jar
- name: Set current date
id: date
run: |
echo "::set-output name=short::$(date +'%Y-%m-%d')"
echo "::set-output name=long::$(date +'%Y-%m-%d %H:%M')"
- name: Post release on Discord
uses: tsickert/[email protected]
with:
webhook-url: ${{ secrets.DISCORD_RELEASE_WEBHOOK_URL }}
embed-color: "4915330"
embed-title: ${{format('Voices of Wynn {0}', needs.changelog.outputs.tag)}}
embed-description: ${{ needs.changelog.outputs.changelog }}
embed-url: ${{ steps.release.outputs.url }}
embed-timestamp: ${{ steps.date.outputs.long }}
release-external:
name: Release to CurseForge
if: ${{ needs.changelog.outputs.skipped != 'true' }}
strategy:
matrix:
modloader: [fabric]
runs-on: ubuntu-latest
needs: [build, changelog]
steps:
- name: Download build
uses: actions/download-artifact@v4
with:
name: build
- uses: Kir-Antipov/[email protected]
with:
curseforge-id: 857921
curseforge-token: ${{ secrets.CF_API_TOKEN }}
files: "**/build/libs/*-${{ matrix.modloader }}*.jar"
name: Voices of Wynn (${{ matrix.modloader }}) ${{ needs.changelog.outputs.tag }}
version: ${{ needs.changelog.outputs.tag }}
version-type: release
game-versions: 1.21
changelog: ${{ needs.changelog.outputs.changelog }}
loaders: ${{ matrix.modloader }}
java: 21