Skip to content

Commit f4cf4d8

Browse files
committed
add cf release workflow
1 parent 1e4167c commit f4cf4d8

File tree

1 file changed

+72
-0
lines changed

1 file changed

+72
-0
lines changed

.github/workflows/release.yml

Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
name: Release
2+
3+
on:
4+
workflow_dispatch:
5+
inputs:
6+
version_type:
7+
description: 'The type of version to release (alpha | beta | release)'
8+
default: 'beta'
9+
required: true
10+
type: string
11+
12+
permissions:
13+
contents: write
14+
15+
jobs:
16+
release:
17+
runs-on: ubuntu-latest
18+
steps:
19+
- name: Checkout Repository
20+
uses: actions/checkout@v2
21+
22+
- name: Setup Java
23+
uses: actions/setup-java@v3
24+
with:
25+
distribution: 'temurin'
26+
java-version: 17
27+
28+
- name: Setup Gradle Caches
29+
uses: actions/cache@v3
30+
with:
31+
path: ~/.gradle/caches
32+
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*') }}
33+
restore-keys: ${{ runner.os }}-gradle
34+
35+
- name: Setup Gradle Wrapper
36+
run: chmod +x gradlew
37+
38+
- name: Get Version
39+
id: gradle_properties
40+
uses: christian-draeger/[email protected]
41+
with:
42+
path: ./gradle.properties
43+
properties: "mod_version"
44+
45+
- name: Get minecraft version
46+
id: toml_properties
47+
uses: SebRollen/[email protected]
48+
with:
49+
file: ./gradle/libs.versions.toml
50+
field: "versions.minecraft"
51+
52+
- name: Build Project
53+
run: ./gradlew build --build-cache
54+
55+
- name: Upload Forge Releases (Curse|Modrinth|Github)
56+
id: forge_release
57+
uses: Kir-Antipov/[email protected]
58+
with:
59+
curseforge-id: ${{ vars.CURSE_ID }}
60+
curseforge-token: ${{ secrets.CURSE_TOKEN }}
61+
62+
github-token: ${{ secrets.GITHUB_TOKEN }}
63+
github-generate-changelog: true
64+
github-tag: "${{ steps.toml_properties.outputs.value }}-${{ steps.gradle_properties.outputs.mod_version }}"
65+
66+
files: ./build/libs/!(*-@(dev|sources|dev-slim)).jar
67+
name: "GregTech Modern Utilities ${{ steps.gradle_properties.outputs.mod_version }}"
68+
version: ${{ steps.gradle_properties.outputs.mod_version }}
69+
version-type: ${{ inputs.version_type }}
70+
changelog-file: changelog.md
71+
loaders: forge
72+
game-versions: ${{ steps.toml_properties.outputs.value }}

0 commit comments

Comments
 (0)