-
Notifications
You must be signed in to change notification settings - Fork 16
96 lines (83 loc) · 2.48 KB
/
publish.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
# Publishes the project to GitHub Releases and CurseForge
name: Publish Nomi Labs
on:
workflow_dispatch:
inputs:
tag:
description: Tag to Release.
required: true
type: string
release_type:
description: The Release Type.
required: true
type: choice
default: 'release'
options:
- 'release'
- 'beta'
- 'alpha'
deploy_to_gh:
description: Whether to deploy to GitHub Releases.
required: true
type: boolean
default: true
deploy_to_cf:
description: Whether to deploy to CurseForge.
required: true
type: boolean
default: true
env:
RELEASE_TYPE: ${{ inputs.release_type }}
jobs:
publishGithub:
name: Publish to GitHub Releases (${{ inputs.tag }})
runs-on: ubuntu-latest
if: ${{ inputs.deploy_to_gh }}
steps:
- name: Get Token
id: token
uses: peter-murray/[email protected]
with:
application_id: ${{ secrets.APP_ID }}
application_private_key: ${{ secrets.APP_KEY }}
organization: Nomi-CEu
- name: Checkout Repository
uses: actions/checkout@v4
with:
ref: ${{ inputs.tag }}
fetch-depth: 0
- name: Setup Build
uses: ./.github/actions/build_setup
- name: Build Project
run: ./gradlew build
- name: Generate Changelog
run: ./gradlew generateChangelog
env:
GITHUB_TAG: ${{ inputs.tag }}
- name: Publish to GitHub
uses: softprops/action-gh-release@v1
with:
files: "build/libs/*.jar"
body_path: "build/changelog.md"
token: ${{ steps.token.outputs.token }}
tag_name: ${{ inputs.tag }}
prerelease: ${{ inputs.release_type != 'release' }}
fail_on_unmatched_files: true
publishCurseForge:
name: Publish to CurseForge (${{ inputs.tag }})
runs-on: ubuntu-latest
if: ${{ inputs.deploy_to_cf }}
steps:
- name: Checkout Repository
uses: actions/checkout@v4
with:
ref: ${{ inputs.tag }}
fetch-depth: 0
- name: Setup Build
uses: ./.github/actions/build_setup
- name: Publish to CurseForge
env:
CURSEFORGE_API_KEY: "${{ secrets.CURSEFORGE_API_KEY }}"
RELEASE_TYPE: "${{ env.RELEASE_TYPE }}"
GITHUB_TAG: ${{ inputs.tag }}
run: ./gradlew curseforge