forked from GeyserMC/Floodgate
-
Notifications
You must be signed in to change notification settings - Fork 6
100 lines (86 loc) · 3.32 KB
/
Copy pathrelease.yml
File metadata and controls
100 lines (86 loc) · 3.32 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
name: Release
on:
# Trigger on GitHub UI release creation
release:
types: [published]
# Trigger on branch push for pre-releases
push:
branches: [connect]
jobs:
build:
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0 # Fetch all history for git describe
- name: Set up JDK 17
uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: '17'
cache: 'gradle'
- name: Setup Gradle
uses: gradle/actions/setup-gradle@v3
- name: Build
run: ./gradlew build
- name: Get version
id: version
run: |
VERSION=$(./gradlew properties -q | grep "^version:" | awk '{print $2}')
echo "version=$VERSION" >> $GITHUB_OUTPUT
echo "Building version: $VERSION"
# For release events: upload artifacts to the release
- name: Upload Release Artifacts
if: github.event_name == 'release'
uses: softprops/action-gh-release@v1
with:
files: |
spigot/build/libs/connect-spigot.jar
velocity/build/libs/connect-velocity.jar
bungee/build/libs/connect-bungee.jar
LICENSE
# Also update "latest" release with stable file names for download sites
- name: Update Latest Release
if: github.event_name == 'release'
uses: softprops/action-gh-release@v1
with:
tag_name: latest
name: "Latest Release (${{ github.ref_name }})"
prerelease: false
files: |
spigot/build/libs/connect-spigot.jar
velocity/build/libs/connect-velocity.jar
bungee/build/libs/connect-bungee.jar
LICENSE
body: |
Latest stable release.
**Version:** ${{ github.ref_name }}
Download links (stable URLs):
- [connect-spigot.jar](https://github.com/${{ github.repository }}/releases/download/latest/connect-spigot.jar)
- [connect-velocity.jar](https://github.com/${{ github.repository }}/releases/download/latest/connect-velocity.jar)
- [connect-bungee.jar](https://github.com/${{ github.repository }}/releases/download/latest/connect-bungee.jar)
# For branch push: create/update pre-release
- name: Prepare Pre-Release Artifacts
if: github.event_name == 'push'
run: |
mkdir -p prerelease
cp spigot/build/libs/connect-spigot.jar prerelease/connect-spigot-prerelease.jar
cp velocity/build/libs/connect-velocity.jar prerelease/connect-velocity-prerelease.jar
cp bungee/build/libs/connect-bungee.jar prerelease/connect-bungee-prerelease.jar
- name: Update Pre-Release
if: github.event_name == 'push'
uses: softprops/action-gh-release@v1
with:
tag_name: latest-prerelease
name: "Latest Pre-Release (${{ steps.version.outputs.version }})"
prerelease: true
files: |
prerelease/*.jar
LICENSE
body: |
Automated pre-release build from `connect` branch.
**Version:** ${{ steps.version.outputs.version }}
**Commit:** ${{ github.sha }}
⚠️ This is a development build and may be unstable.