This repository has been archived by the owner on Apr 21, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
72 lines (61 loc) · 2.04 KB
/
push.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
name: Push Build
on:
push:
paths:
- ".github/workflows/**.yml"
- "**.java"
- "config.toml"
- "plugin.yml"
- "**.gradle"
- "gradle.properties"
workflow_dispatch:
jobs:
build:
if: ${{ !startsWith(github.ref.name, 'refs/tags/') && contains(github.event.head_commit.message, '[build skip]') == false }}
permissions:
contents: write
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
submodules: true
- name: Setup jdk 17
uses: actions/setup-java@v4
with:
distribution: 'zulu'
java-version: '17'
- uses: gradle/wrapper-validation-action@v2
- name: Fix Gradle permission
run: chmod +x gradlew
- name: Build with Gradle
run: ./gradlew buildArtifacts --stacktrace --no-daemon
- name: Get short SHA
run: echo "SHORT_SHA=${GITHUB_SHA::7}" >> $GITHUB_ENV
- name: Read Properties info
id: prop_info
uses: christian-draeger/[email protected]
with:
path: gradle.properties
properties: "release_version"
- name: Upload Artifacts
uses: actions/upload-artifact@v4
with:
name: TubeNekoPlugin-${{ env.SHORT_SHA }}
path: |
bukkit/build/libs/*.jar
bungeecord/build/libs/*.jar
common/build/libs/*.jar
velocity/build/libs/*.jar
- name: Create GitHub Release
if: ${{ contains(github.event.head_commit.message, '[publish skip]') == false && contains(github.event.head_commit.message, 'release:') }}
uses: softprops/action-gh-release@v2
with:
files: |
build/libs/*.jar
name: ${{ steps.prop_info.outputs.release_version }}
tag_name: ${{ steps.prop_info.outputs.release_version }}-${{ env.SHORT_SHA }}
make_latest: "true"
target_commitish: ${{ github.event.ref }}
generate_release_notes: true
token: ${{ secrets.RELEASE_TOKEN }}