-
Notifications
You must be signed in to change notification settings - Fork 0
94 lines (79 loc) · 2.65 KB
/
ci.yaml
File metadata and controls
94 lines (79 loc) · 2.65 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
name: CI
on:
push:
branches:
- master
pull_request:
branches:
- master
jobs:
test:
runs-on: ubuntu-latest
steps:
- name: Checkout Repository
uses: actions/checkout@v4
- uses: actions/setup-java@v4
with:
java-version: '17'
distribution: 'temurin'
- name: Setup Gradle
uses: gradle/actions/setup-gradle@v5
- name: Make gradlew executable
run: chmod +x ./gradlew
- name: Test with Gradle
run: ./gradlew test
release:
runs-on: ubuntu-latest
needs: test
if: github.event_name == 'push' && github.ref == 'refs/heads/master'
permissions:
contents: write
steps:
- name: Checkout Repository
uses: actions/checkout@v4
- uses: actions/setup-java@v4
with:
java-version: '17'
distribution: 'temurin'
- name: Setup Gradle
uses: gradle/actions/setup-gradle@v5
- name: Make gradlew executable
run: chmod +x ./gradlew
- name: Build with Gradle
run: ./gradlew build
- name: Get Version
id: get_version
run: echo "version=$(grep 'version = ' build.gradle.kts | cut -d '"' -f 2)" >> $GITHUB_OUTPUT
- name: Create Release
uses: softprops/action-gh-release@v1
with:
tag_name: v${{ steps.get_version.outputs.version }}
name: v${{ steps.get_version.outputs.version }}
body: |
Automated release v${{ steps.get_version.outputs.version }}
Commit: ${{ github.sha }} - ${{ github.event.head_commit.message }}
files: build/libs/*.jar
draft: false
prerelease: false
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Find release "-all.jar"
id: find_release
run: |
echo "release_file=$(ls build/libs/*-all.jar)" >> $GITHUB_OUTPUT
- name: Publish to Modrinth
uses: cloudnode-pro/modrinth-publish@v2
with:
token: ${{ secrets.MODRINTH_SECRET }}
name: ${{ steps.get_version.outputs.version }}
changelog: |
Automated release v${{ steps.get_version.outputs.version }}
Commit: ${{ github.sha }} - ${{ github.event.head_commit.message }}
See the GitHub release for more details:
https://github.com/integr-dev/backbone/releases/tag/v${{ steps.get_version.outputs.version }}
channel: release
project: C7VBofq0
version: ${{ steps.get_version.outputs.version }}
loaders: paper
game-versions: 1.21.11
files: ${{ steps.find_release.outputs.release_file }}