forked from Wynntils/Wynntils
-
Notifications
You must be signed in to change notification settings - Fork 0
156 lines (135 loc) · 4.51 KB
/
alpha-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
name: Publish Alpha Release
on:
push:
branches:
- alpha
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 }}
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/conventional-changelog-action@v3.17.0
with:
github-token: ${{ secrets.PRIVATE_TOKEN }}
git-user-name: 'WynntilsBot'
git-user-email: 'admin@wynntils.com'
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: alpha
- 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: 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
- name: Cache Gradle data
uses: actions/cache@v3
with:
path: .gradle
key: ${{ runner.os }}-gradle--${{ hashFiles('**/settings.gradle', '**/gradle.properties') }}
- uses: actions/download-artifact@v3 # Download version information from changelog
with:
name: build
- name: Set up JDK 17
uses: actions/setup-java@v3
with:
distribution: "temurin"
java-version: 17
cache: "gradle"
- name: Build with Gradle
uses: gradle/gradle-build-action@v2
with:
arguments: buildDependents -x spotlessCheck
- 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/libs/*-fabric+MC-*.jar
**/build/libs/*-forge+MC-*.jar
**/build/libs/*-quilt+MC-*.jar
- name: Upload build
uses: actions/upload-artifact@v3
with:
name: build
path: |
**/build/libs/*-fabric+MC-*.jar
**/build/libs/*-forge+MC-*.jar
**/build/libs/*-quilt+MC-*.jar
if-no-files-found: error
release:
name: Release to Modrinth and CurseForge
if: ${{ needs.changelog.outputs.skipped != 'true' }}
strategy:
matrix:
modloader: [fabric, forge, quilt]
runs-on: ubuntu-latest
needs: [build, changelog]
steps:
- uses: actions/download-artifact@v3
with:
name: build
- uses: Kir-Antipov/mc-publish@v3.2
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: "**/build/libs/*-${{ matrix.modloader }}*.jar"
files-secondary: ""
name: Wynntils Artemis (${{ matrix.modloader }}) ${{ needs.changelog.outputs.tag }}
version: ${{ needs.changelog.outputs.tag }}
version-type: alpha
changelog: ${{ needs.changelog.outputs.changelog }}
loaders: ${{ matrix.modloader }}
java: 17
release-gh:
name: Release Github
if: ${{ needs.changelog.outputs.skipped != 'true' }}
runs-on: ubuntu-latest
needs: [build, changelog]
steps:
- name: Publish Release
uses: eregon/publish-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
release_id: ${{ needs.changelog.outputs.release_id }}