-
-
Notifications
You must be signed in to change notification settings - Fork 18
79 lines (71 loc) · 2.79 KB
/
build.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
73
74
75
76
77
78
79
name: build
on:
push:
branches: [ master, dev ]
tags:
- 'v*'
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up Java 17
uses: actions/setup-java@v2
with:
distribution: 'temurin'
java-version: '17'
- name: Install dependencies
run: |
sudo apt-get -y install libxml2-utils rpm
- name: Graylog version
id: vinfo
run: |
export GRAYLOG_VERSION=$(xmllint --xpath '/*[local-name()="project"]/*[local-name()="parent"]/*[local-name()="version"]/text()' pom.xml)
echo "Building for Graylog ${GRAYLOG_VERSION}"
echo "GRAYLOG_VERSION=${GRAYLOG_VERSION}" >> $GITHUB_ENV
echo "::set-output name=GRAYLOG_VERSION::$GRAYLOG_VERSION"
echo "::set-output name=date::$(/bin/date -u "+%Y%m%d")"
- uses: actions/cache@v3
id: cache
with:
path: /home/runner/work/TelegramAlert/graylog2-server
key: ${{ runner.os }}-${{ steps.vinfo.outputs.date }}-${{ steps.vinfo.outputs.GRAYLOG_VERSION }}
- name: Initialize Graylog
if: steps.cache.outputs.cache-hit != 'true'
run: |
echo "Checking out Graylog ${{ env.GRAYLOG_VERSION }}"
git clone --depth 1 --branch "${{ env.GRAYLOG_VERSION }}" https://github.com/Graylog2/graylog2-server.git ../graylog2-server
pushd ../graylog2-server
./mvnw compile
popd
- name: Build
run: ../graylog2-server/mvnw -B package --file pom.xml
- name: Package deb
if: startsWith(github.ref, 'refs/tags/v')
run: ../graylog2-server/mvnw jdeb:jdeb
- name: Package rpm
if: startsWith(github.ref, 'refs/tags/v')
run: ../graylog2-server/mvnw rpm:rpm
- name: Cleanup
if: startsWith(github.ref, 'refs/tags/v')
run: rm -f target/original-*.jar
- name: Release
if: startsWith(github.ref, 'refs/tags/v')
uses: softprops/action-gh-release@v1
with:
files: |
target/*.jar
target/*.deb
target/**/*.rpm
body: |
This release **requires Graylog X.X.X or later**
To update the plugin you need to remove the old `telegram-alert-x.x.x.jar` file from your plugins folder and follow the [installation instructions](https://github.com/irgendwr/TelegramAlert#installation) again.
## Changelog
- XXX
---
In case you like this plugin I would be happy if you could star ⭐️ this repository to keep me motivated 😄
If you want to support my work directly, you can also [sponsor me on GitHub](https://github.com/sponsors/irgendwr).
TelegramAlert currently has XXX ⭐ stars.
draft: true
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}