-
Notifications
You must be signed in to change notification settings - Fork 1
114 lines (101 loc) · 2.97 KB
/
release.yml
File metadata and controls
114 lines (101 loc) · 2.97 KB
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
name: Release
on:
workflow_dispatch:
inputs:
publish_github:
description: Publish to GitHub
type: boolean
default: true
publish_curseforge:
description: Publish to CurseForge
type: boolean
default: true
publish_modrinth:
description: Publish to Modrinth
type: boolean
default: true
publish_hexdoc:
description: Publish hexdoc book
type: boolean
default: true
dry_run:
description: Perform a dry run
type: boolean
default: false
env:
PYPI_PACKAGE: hexdoc-caduceus
jobs:
build:
uses: ./.github/workflows/build.yml
permissions:
contents: write
pages: read
with:
mod_release: ${{ inputs.publish_curseforge || inputs.publish_modrinth || inputs.publish_github }}
hexdoc_release: ${{ inputs.publish_hexdoc }}
dry_run: ${{ inputs.dry_run }}
publish-mod:
needs: build
if: inputs.publish_curseforge || inputs.publish_modrinth || inputs.publish_github
runs-on: ubuntu-latest
environment:
name: curseforge-modrinth
permissions:
contents: write
steps:
- uses: actions/checkout@v4
- uses: actions/setup-java@v4
with:
distribution: temurin
java-version: 17
- uses: gradle/actions/setup-gradle@v4
- name: Build mod
env:
RELEASE: true
run: ./gradlew build
# do this first so we fail if we've already published this version
# because CurseForge and Modrinth apparently don't care!
- name: Publish to GitHub
if: inputs.publish_github
env:
RELEASE: true
DRY_RUN: ${{ inputs.dry_run && 'true' || '' }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: ./gradlew publishGithub
- name: Publish to CurseForge
if: inputs.publish_curseforge
env:
RELEASE: true
DRY_RUN: ${{ inputs.dry_run && 'true' || '' }}
CURSEFORGE_TOKEN: ${{ secrets.CURSEFORGE_TOKEN }}
run: ./gradlew publishCurseforge
- name: Publish to Modrinth
if: inputs.publish_modrinth
env:
RELEASE: true
DRY_RUN: ${{ inputs.dry_run && 'true' || '' }}
MODRINTH_TOKEN: ${{ secrets.MODRINTH_TOKEN }}
run: ./gradlew publishModrinth
- name: Upload dry run artifact
if: inputs.dry_run
uses: actions/upload-artifact@v4
with:
name: dry-run
path: '*/build/publishMods'
if-no-files-found: error
publish-pypi:
needs: build
if: inputs.publish_hexdoc && !inputs.dry_run
runs-on: ubuntu-latest
environment:
name: pypi
url: https://pypi.org/p/${{ env.PYPI_PACKAGE }}
permissions:
id-token: write
steps:
- uses: actions/download-artifact@v4
with:
name: hexdoc-build
path: dist
- name: Publish to PyPI
uses: pypa/gh-action-pypi-publish@release/v1