forked from isXander/Controlify
-
Notifications
You must be signed in to change notification settings - Fork 0
65 lines (55 loc) · 1.87 KB
/
Copy pathpublish.yml
File metadata and controls
65 lines (55 loc) · 1.87 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
name: Publish
on:
push:
branches:
- multiversion/prod
jobs:
build:
runs-on: ubuntu-latest
name: Build with gradle
steps:
- uses: actions/checkout@v4
- name: Get mod version
id: version
run: |
echo "::set-output name=VER::$(grep '^modVersion=' gradle.properties | cut -d'=' -f2)"
- name: Fail if version already published
run: |
if git rev-parse -q --verify "refs/tags/v${{ steps.version.outputs.VER }}" >/dev/null; then
echo "✋ Version ${{ steps.version.outputs.VER }} already exists, aborting."
exit 1
fi
- name: Set up JDK
uses: actions/setup-java@v4
with:
java-version: 21
distribution: temurin
- name: Setup gradle
uses: gradle/actions/setup-gradle@v3
with:
cache-read-only: false
- name: Build all
run: ./gradlew build --stacktrace
- name: Publish to Modrinth
run: ./gradlew publishModrinth --stacktrace -Pmodrinth.token=${{ secrets.MODRINTH_TOKEN }}
- name: Publish to CurseForge
run: ./gradlew publishCurseForge --stacktrace -Pcurseforge.token=${{ secrets.CURSEFORGE_TOKEN }}
- name: Publish to Maven
run: ./gradlew publish --stacktrace
env:
XANDER_MAVEN_USER: ${{ secrets.XANDER_MAVEN_USER }}
XANDER_MAVEN_PASS: ${{ secrets.XANDER_MAVEN_PASS }}
- name: Create git tag
run: |
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"
git tag v${{ steps.version.outputs.VER }}
git push origin v${{ steps.version.outputs.VER }}
# run:
# needs: build
# runs-on: ubuntu-latest
# name: Run Minecraft
#
# strategy:
# matrix:
# target: ${{ fromJson(needs.retrieve-targets.outputs.targets) }}