Skip to content

Commit 5f07770

Browse files
committed
Create release.yml
1 parent e86cdfa commit 5f07770

1 file changed

Lines changed: 80 additions & 0 deletions

File tree

.github/workflows/release.yml

Lines changed: 80 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,80 @@
1+
name: Release
2+
3+
permissions:
4+
contents: write
5+
6+
on:
7+
push:
8+
tags:
9+
- "v*"
10+
branches:
11+
- production
12+
workflow_dispatch:
13+
14+
jobs:
15+
release:
16+
runs-on: ubuntu-latest
17+
timeout-minutes: 30
18+
19+
steps:
20+
- name: Checkout repository
21+
uses: actions/checkout@v4
22+
with:
23+
fetch-depth: 1
24+
25+
- name: Set up JDK 11
26+
uses: actions/setup-java@v4
27+
with:
28+
distribution: temurin
29+
java-version: "11"
30+
cache: gradle
31+
32+
- name: Build shadow JAR
33+
run: |
34+
chmod +x gradlew
35+
./gradlew shadowJar --no-daemon --stacktrace
36+
37+
- name: Verify JAR output
38+
run: test -f build/libs/openrune-server.jar
39+
40+
- name: Set release metadata
41+
id: meta
42+
run: |
43+
if [[ "${GITHUB_REF}" == refs/tags/* ]]; then
44+
TAG="${GITHUB_REF_NAME}"
45+
NAME="Release ${TAG}"
46+
else
47+
DATE="$(date -u +'%Y-%m-%d')"
48+
BRANCH="${GITHUB_REF_NAME}"
49+
BRANCH_TAG="$(echo "$BRANCH" | tr '/' '-')"
50+
SHORT_SHA="$(git rev-parse --short HEAD)"
51+
TAG="${DATE}-${BRANCH_TAG}-${SHORT_SHA}"
52+
NAME="${DATE} - ${BRANCH}"
53+
fi
54+
55+
FULL_SHA="$(git rev-parse HEAD)"
56+
echo "tag=${TAG}" >> "$GITHUB_OUTPUT"
57+
echo "name=${NAME}" >> "$GITHUB_OUTPUT"
58+
echo "short_sha=$(git rev-parse --short HEAD)" >> "$GITHUB_OUTPUT"
59+
echo "commit_url=${{ github.server_url }}/${{ github.repository }}/commit/${FULL_SHA}" >> "$GITHUB_OUTPUT"
60+
61+
- name: Create GitHub release
62+
uses: softprops/action-gh-release@v2
63+
with:
64+
tag_name: ${{ steps.meta.outputs.tag }}
65+
name: ${{ steps.meta.outputs.name }}
66+
body: |
67+
OpenRune WebServer shadow JAR.
68+
69+
**Commit:** [`${{ steps.meta.outputs.short_sha }}`](${{ steps.meta.outputs.commit_url }})
70+
71+
## Run
72+
```bash
73+
java -jar openrune-server.jar -1 OLDSCHOOL LIVE 8090
74+
```
75+
76+
## Pterodactyl egg
77+
- `JAR_UPDATE_REPO`: `Mark7625/OpenRune-WebServer`
78+
- `SERVER_JAR`: `openrune-server.jar`
79+
files: build/libs/openrune-server.jar
80+
generate_release_notes: false

0 commit comments

Comments
 (0)