-
Notifications
You must be signed in to change notification settings - Fork 5
75 lines (72 loc) · 2.96 KB
/
Copy pathprerelease.yml
File metadata and controls
75 lines (72 loc) · 2.96 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
name: prerelease
env:
PROJECT_NAME: GraphLib
JAVADOC_DIR: com/kneelawk/graphlib/graphlib-javadoc-xplat
MAVEN_IDENTIFIER: 'com.kneelawk.graphlib:graphlib-core-xplat-intermediary'
ROLE_ID: '1239437674058879047'
on:
push:
tags:
# matches things like v0.1.2-alpha.1+1.18.2
- 'v[0-9]+.[0-9]+.[0-9]+-alpha.[0-9]+\+[0-9]+.[0-9]+.[0-9]+'
# matches things like v0.1.2-beta.1+1.18.2
- 'v[0-9]+.[0-9]+.[0-9]+-beta.[0-9]+\+[0-9]+.[0-9]+.[0-9]+'
# matches things like v0.1.2-pre.1+1.18.2
- 'v[0-9]+.[0-9]+.[0-9]+-pre.[0-9]+\+[0-9]+.[0-9]+.[0-9]+'
# matches things like v0.3.0-alpha.1+1.19
- 'v[0-9]+.[0-9]+.[0-9]+-alpha.[0-9]+\+[0-9]+.[0-9]+'
# matches things like v0.3.0-beta.1+1.19
- 'v[0-9]+.[0-9]+.[0-9]+-beta.[0-9]+\+[0-9]+.[0-9]+'
# matches things like v0.3.0-pre.1+1.19
- 'v[0-9]+.[0-9]+.[0-9]+-pre.[0-9]+\+[0-9]+.[0-9]+'
jobs:
prerelease:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup JDK 21
uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: 21
- name: Make Gradle Wrapper Executable
run: chmod +x ./gradlew
- name: Build
run: ./gradlew build
env:
RELEASE_TAG: ${{ github.ref_name }}
- name: Github Release
uses: softprops/action-gh-release@v2
with:
files: build/libs/*
env:
GITHUB_TOKEN: ${{ secrets.PUBLISH_TOKEN }}
- name: Maven Release
run: ./gradlew publish -PkneelawkUsername=${{ secrets.MAVEN_USERNAME }} -PkneelawkPassword=${{ secrets.MAVEN_PASSWORD }}
env:
RELEASE_TAG: ${{ github.ref_name }}
# This is the mess that publishes discord notifications
- name: Process for Announcement
uses: actions/github-script@v7
id: announcement_text
env:
TAG_VERSION: ${{ github.ref_name }}
with:
script: |
let fullVersion = process.env.TAG_VERSION;
let versions = fullVersion.split('+');
let mavenVersion = fullVersion.substring(1);
let lines = [];
lines.push(`# ${process.env.PROJECT_NAME} Prerelease`);
lines.push(`**<@&${process.env.ROLE_ID}> ${process.env.PROJECT_NAME} prerelease ${versions[0]} has been published for Minecraft ${versions[1]}!**`);
lines.push("Available on Kneelawk's maven: https://maven.kneelawk.com/releases/", `With the identifier: \`${process.env.MAVEN_IDENTIFIER}:${mavenVersion}\``);
lines.push(`Javadoc available at: https://maven.kneelawk.com/javadoc/releases/${process.env.JAVADOC_DIR}/${mavenVersion}`);
return lines.join('\n');
result-encoding: string
- name: Make Release Announcement
uses: Ilshidur/action-discord@0.3.2
env:
DISCORD_WEBHOOK: ${{ secrets.DISCORD_WEBHOOK }}
with:
args: ${{ steps.announcement_text.outputs.result }}