-
Notifications
You must be signed in to change notification settings - Fork 1
executable file
·76 lines (64 loc) · 2.01 KB
/
build.yml
File metadata and controls
executable file
·76 lines (64 loc) · 2.01 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
# Automatically build the project and run any configured tests for every push
# and submitted pull request. This can help catch issues that only occur on
# certain platforms or Java versions, and provides a first line of defence
# against bad commits.
name: build
on:
release:
types:
- published
push:
branches:
- '**'
tags-ignore:
- '**'
pull_request:
workflow_dispatch:
permissions:
id-token: write
attestations: write
contents: write
jobs:
release:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: JDK Setup
uses: actions/setup-java@v4
with:
java-version: 21
distribution: 'temurin'
- name: Gradle Setup
uses: gradle/actions/setup-gradle@v4
with:
validate-wrappers: true
- name: Enable gradlew execution
run: chmod +x ./gradlew
- name: Gradle Build
run: ./gradlew build
- name: Attest Build Provenance
uses: actions/attest-build-provenance@v2
with:
subject-path: '**/build/libs/*.jar, !**/build/libs/*-sources.jar'
- name: Upload Artifacts
uses: actions/upload-artifact@v4
with:
name: Artifacts
path: |
**/build/libs/*.jar
!**/build/libs/*-sources.jar
- name: Github Publish
if: github.event_name == 'release' && github.event.action == 'published'
uses: AButler/upload-release-assets@v2.0
with:
files: '**/build/libs/*.jar;!**/build/libs/*-sources.jar'
repo-token: ${{ secrets.GITHUB_TOKEN }}
- name: Modrinth Publish
env:
MODRINTH_TOKEN: ${{ secrets.MODRINTH_TOKEN }}
CHANGELOG: ${{ github.event.release.body }}
if: ${{ github.event_name == 'release' && github.event.action == 'published' && env.MODRINTH_TOKEN != '' }}
run: |
./gradlew --no-configuration-cache modrinth
./gradlew --no-configuration-cache modrinthSyncBody