-
-
Notifications
You must be signed in to change notification settings - Fork 33
116 lines (101 loc) · 3.6 KB
/
github.yml
File metadata and controls
116 lines (101 loc) · 3.6 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
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
name: Build and publish
on:
push:
branches:
- develop
jobs:
build:
name: Build LEGUI
runs-on: ubuntu-latest
steps:
# CHECKOUT
- uses: actions/checkout@v4
# EVALUATE VARIABLES
- name: Get Version Property
id: read_property
uses: christian-draeger/read-properties@1.1.1
with:
path: ./gradle.properties
properties: version
- name: Set environment variables
run: |
echo "branch=develop" >> $GITHUB_ENV
echo "publishUrl=git:releases://git@github.com:SpinyOwl/repo.git" >> $GITHUB_ENV
echo "version=${{steps.read_property.outputs.value}}" >> $GITHUB_ENV
echo "repoUrl=https://github.com/SpinyOwl/repo/tree/releases/com/spinyowl/legui" >> $GITHUB_ENV
# CALL WEBHOOK
- name: Send message build started
uses: rjstone/discord-webhook-notify@v1.0.4
with:
severity: info
color: '#808080'
description: Build started
footer: "https://github.com/SpinyOwl/legui"
webhookUrl: ${{ secrets.WEBHOOK_URL }}
# PREPARE AND BUILD
- name: Set up JDK
uses: actions/setup-java@v4
with:
java-version: 24
distribution: 'temurin'
cache: 'gradle'
- name: Build with Gradle
run: ./gradlew build
# RUN TESTS
- name: Run tests
run: ./gradlew test
# PUBLISH ARTIFACTS
- name: Build artifacts
run: ./gradlew publish
- name: Publish Artifact to GIT
uses: SpinyOwl/publish-artifact-to-git@1.0.1
if: "!contains(github.event.head_commit.message, '[skip publish]')"
with:
repository: SpinyOwl/repo
branch: releases
github_token: '${{ secrets.GITHUB_TOKEN }}'
github_pat: '${{ secrets.GH_PAT }}'
source_folder: build/publish
no_delete: true
# CALL WEBHOOK
- name: Send message build finished
uses: rjstone/discord-webhook-notify@v1.0.4
if: success() && !contains(github.event.head_commit.message, '[skip publish]')
with:
severity: info
details: |
Build successfully finished.
**Artifact version** - `${{env.version}}`.
Browse artifacts: [Browse artifacts](${{env.repoUrl}}/${{env.version}})
footer: "https://github.com/SpinyOwl/legui"
webhookUrl: ${{ secrets.WEBHOOK_URL }}
- name: Send message build finished
uses: rjstone/discord-webhook-notify@v1.0.4
if: success() && contains(github.event.head_commit.message, '[skip publish]')
with:
severity: info
details: |
Build successfully finished.
Browse artifacts: [Browse artifacts](${{env.repoUrl}})
footer: "https://github.com/SpinyOwl/legui"
webhookUrl: ${{ secrets.WEBHOOK_URL }}
- name: Send message build failed
uses: rjstone/discord-webhook-notify@v1.0.4
if: failure()
with:
severity: error
details: |
Build failed.
Browse artifacts: [Browse artifacts](${{env.repoUrl}})
footer: "https://github.com/SpinyOwl/legui"
webhookUrl: ${{ secrets.WEBHOOK_URL }}
- name: Send message build cancelled
uses: rjstone/discord-webhook-notify@v1.0.4
if: cancelled()
with:
severity: warn
details: |
Build cancelled.
Browse artifacts: [Browse artifacts](${{env.repoUrl}})
footer: "https://github.com/SpinyOwl/legui"
webhookUrl: ${{ secrets.WEBHOOK_URL }}