forked from GeyserMC/Floodgate
-
Notifications
You must be signed in to change notification settings - Fork 3
90 lines (78 loc) · 2.96 KB
/
release.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
name: release
on:
push:
branches: [ connect ]
tags: [ "*.*.*" ]
jobs:
build:
runs-on: ubuntu-latest
permissions:
contents: write
env:
RELEASE_DIR: release
LATEST_RELEASE_DIR: latest/release
LATEST_PRERELEASE_DIR: latest/prerelease
steps:
- uses: actions/checkout@v3
- name: Set up JDK 17
uses: actions/setup-java@v3
with:
distribution: 'temurin'
java-version: '17'
- name: Setup Gradle
uses: gradle/gradle-build-action@v2
- name: Build with Maven
run: ./gradlew build
- name: Rename JARs for Latest Pre-Release
if: ${{ !startsWith(github.ref, 'refs/tags/') }}
run: |
mkdir -p ${LATEST_PRERELEASE_DIR}
cp spigot/build/libs/connect-spigot.jar ${LATEST_PRERELEASE_DIR}/connect-spigot-prerelease.jar
cp velocity/build/libs/connect-velocity.jar ${LATEST_PRERELEASE_DIR}/connect-velocity-prerelease.jar
cp bungee/build/libs/connect-bungee.jar ${LATEST_PRERELEASE_DIR}/connect-bungee-prerelease.jar
- name: Rename JARs for Latest Release
if: startsWith(github.ref, 'refs/tags/')
run: |
mkdir -p ${LATEST_RELEASE_DIR}
cp spigot/build/libs/connect-spigot.jar ${LATEST_RELEASE_DIR}/connect-spigot.jar
cp velocity/build/libs/connect-velocity.jar ${LATEST_RELEASE_DIR}/connect-velocity.jar
cp bungee/build/libs/connect-bungee.jar ${LATEST_RELEASE_DIR}/connect-bungee.jar
- name: Rename JARs for Release
if: startsWith(github.ref, 'refs/tags/')
run: |
mkdir -p ${RELEASE_DIR}
REF=${GITHUB_REF##*/}
cp spigot/build/libs/connect-spigot.jar ${RELEASE_DIR}/connect-spigot-${REF}.jar
cp velocity/build/libs/connect-velocity.jar ${RELEASE_DIR}/connect-velocity-${REF}.jar
cp bungee/build/libs/connect-bungee.jar ${RELEASE_DIR}/connect-bungee-${REF}.jar
- name: Latest Pre Release
uses: marvinpinto/action-automatic-releases@latest
if: ${{ !startsWith(github.ref, 'refs/tags/') }}
with:
repo_token: ${{ secrets.GH_TOKEN }}
automatic_release_tag: latest-prerelease
prerelease: true
title: Latest Pre-Release
files: |
latest/prerelease/*.jar
LICENSE
- name: Latest Release
uses: marvinpinto/action-automatic-releases@latest
if: startsWith(github.ref, 'refs/tags/')
with:
repo_token: ${{ secrets.GH_TOKEN }}
automatic_release_tag: latest
prerelease: false
title: Latest Release
files: |
latest/release/*.jar
LICENSE
- name: Release version
uses: marvinpinto/action-automatic-releases@latest
if: startsWith(github.ref, 'refs/tags/')
with:
repo_token: ${{ secrets.GH_TOKEN }}
prerelease: false
files: |
release/*.jar
LICENSE