-
-
Notifications
You must be signed in to change notification settings - Fork 23
96 lines (93 loc) · 2.84 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
name: Release
on:
workflow_dispatch:
inputs:
release_type:
description: 'The published artifact release type'
required: false
default: 'STABLE'
type: choice
options:
- STABLE
- BETA
- ALPHA
permissions:
actions: read
contents: write
jobs:
build:
name: Build
runs-on: ubuntu-22.04
outputs:
changelog: ${{ steps.changelog.outputs.changelog }}
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: FabricMC/fabric-action-scripts@v2
id: changelog
with:
context: changelog
workflow_id: release.yml
- uses: actions/setup-java@v3
with:
distribution: 'microsoft'
java-version: '21'
- uses: gradle/actions/wrapper-validation@v3
- name: Setup Gradle
uses: gradle/actions/setup-gradle@v3
with:
gradle-home-cache-cleanup: false # Temporarily disabled
gradle-home-cache-excludes: |
gradle.properties
- name: Build with Gradle
run: ./gradlew clean build --stacktrace
publish:
strategy:
matrix:
include:
- name: Maven
task: publish
url: https://maven.su5ed.dev/releases/dev/su5ed/sinytra/Connector
- name: GitHub
task: publishGithub
url: https://github.com/Sinytra/Connector/releases
- name: CurseForge
task: publishCurseforge
url: https://www.curseforge.com/minecraft/mc-mods/sinytra-connector
- name: Modrinth
task: publishModrinth
url: https://modrinth.com/mod/connector
name: Publish ${{ matrix.name }}
needs: build
runs-on: ubuntu-22.04
environment:
name: ${{ matrix.name }}
url: ${{ matrix.url }}
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: actions/setup-java@v3
with:
distribution: 'microsoft'
java-version: '21'
- uses: gradle/actions/wrapper-validation@v3
- name: Setup Gradle
uses: gradle/actions/setup-gradle@v3
with:
cache-read-only: true
gradle-home-cache-cleanup: true
gradle-home-cache-excludes: |
gradle.properties
- name: Publish with Gradle
run: ./gradlew clean build ${{ matrix.task }} --stacktrace
env:
PUBLISH_RELEASE_TYPE: ${{ inputs.release_type }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
CURSEFORGE_TOKEN: ${{ secrets.CURSEFORGE_TOKEN }}
MODRINTH_TOKEN: ${{ secrets.MODRINTH_TOKEN }}
MAVEN_URL: ${{ secrets.MAVEN_URL }}
MAVEN_USERNAME: ${{ secrets.MAVEN_USERNAME }}
MAVEN_PASSWORD: ${{ secrets.MAVEN_PASSWORD }}
CHANGELOG: ${{ needs.build.outputs.changelog }}