-
Notifications
You must be signed in to change notification settings - Fork 4
82 lines (81 loc) · 2.89 KB
/
main.yaml
File metadata and controls
82 lines (81 loc) · 2.89 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
name: Nightly
on:
push:
branches:
- developer
paths:
- '.github/workflows/main.yaml'
- 'src/**'
- 'deps/**'
- 'pom.xml'
workflow_dispatch:
jobs:
build:
runs-on: self-hosted
steps:
- uses: actions/checkout@v4
- name: Set up JDK 17
uses: actions/setup-java@v4.6.0
with:
java-version: '8'
distribution: 'corretto'
- name: Set up maven
uses: s4u/setup-maven-action@v1.18.0
with:
java-version: '8'
- name: Setup Gradle
uses: gradle/actions/setup-gradle@017a9effdb900e5b5b2fddfb590a105619dca3c3
- name: Clone Repository
run: git clone --branch developer --recursive https://github.com/NTifyApp/NTify
- name: Get commit ID
id: get_commit_id
run: echo "COMMIT_ID=${GITHUB_SHA}" >> "$GITHUB_OUTPUT"
- name: Save commit ID to file
working-directory: ./NTify
run: echo ${{ steps.get_commit_id.outputs.COMMIT_ID }} > src/main/resources/commit_id.txt
- name: Build with Maven and build.py
working-directory: ./NTify
run: python3 build.py
- name: Upload a Build Artifact
uses: actions/upload-artifact@v4.6.0
with:
name: Build
path: /home/grunner/actions-runner/_work/NTify/NTify/NTify/target/NTify.jar
- name: Get commit info
id: commit
run: |
echo "sha=$(git rev-parse --short HEAD)" >> $GITHUB_ENV
echo "title=$(git log -1 --pretty=format:%s)" >> $GITHUB_ENV
echo "message<<EOF" >> $GITHUB_ENV
git log -1 --pretty=format:%b >> $GITHUB_ENV
echo "EOF" >> $GITHUB_ENV
- name: Creating release
uses: softprops/action-gh-release@v2
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ env.sha }}
name: ${{ env.title }}
files: /home/grunner/actions-runner/_work/NTify/NTify/NTify/target/NTify.jar
draft: 'false'
prerelease: 'false'
- name: Make public directory
working-directory: ./NTify
run: mkdir public
- name: Copy app screenshot to public directory
working-directory: ./NTify
run: cp NTifyShowStable.png public/
- name: Copy newest release to public directory
working-directory: ./NTify
run: cp /home/grunner/actions-runner/_work/NTify/NTify/NTify/target/NTify.jar public/
- name: Copy release title to public directory
working-directory: ./NTify
run: echo ${{ env.title }} > public/commit_title.txt
- name: Copy release message to public directory
working-directory: ./NTify
run: echo '${{ env.message }}' > public/commit_message.txt
- name: Upload to GitHub Pages
uses: peaceiris/actions-gh-pages@v4
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./NTify/public