-
Notifications
You must be signed in to change notification settings - Fork 0
107 lines (88 loc) · 3.14 KB
/
maven.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
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
# This workflow will build a Java project with Maven
# For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-maven
name: Java CI with Maven
on:
push:
branches: [ master, dev ]
pull_request:
branches: [ master, dev ]
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-latest
steps:
- name : Checkout Repo
uses: actions/[email protected]
with:
fetch-depth: '5'
- name: Manage Version
run: |
echo "JEKYLL_GITHUB_TOKEN=${{ secrets.GITHUB_TOKEN }}" >> $GITHUB_ENV
git fetch --prune --unshallow --tags
GIT_SHA="$(git rev-parse --short HEAD)"
CUR_TAG="$(git tag -l | grep 'alpha' | tail -1)"
echo "SHORT_SHA=$GIT_SHA" >> $GITHUB_ENV
DATE_CURRENT="$(date +'%Y%m%d')"
echo "DATE=$DATE_CURRENT" >> $GITHUB_ENV
if [[ -z $CUR_TAG ]]; then
echo "OLD_PRE_TAG=NULL" >> $GITHUB_ENV
else
echo "OLD_PRE_TAG=$CUR_TAG" >> $GITHUB_ENV
fi
- name: Setuping Node latest version
uses: actions/[email protected]
with:
node-version: '16'
check-latest: true
- name: Set up JDK 8
uses: actions/[email protected]
with:
distribution: zulu
java-version: 8
cache: maven
- name: Setup Ruby
uses: ruby/[email protected]
with:
ruby-version: '3.0'
bundler-cache: true
- name: Test Compile Site & Project GUI
run: JEKYLL_GITHUB_TOKEN=${{ secrets.GITHUB_TOKEN }} npm run test-build && npm run test-site
- name: Build Project GUI
run: npm run build
- name: Preparing Artifact
run: "sudo cp target/SSBPN-1.4-alpha-jar-with-dependencies.jar SSBPN-1.4-alpha.jar"
- name: Generate Prerelease Release Notes
run: |
echo '### Disclaimer:' >> ReleaseNotes.md
echo '***This alpha version is for testing only.***' >> ReleaseNotes.md
echo 'It is not ready for daily use and we do not guarantee its usability.' >> ReleaseNotes.md
echo '### The latest five updates are:' >> ReleaseNotes.md
git log -"5" --format="- %H %s" | sed '/^$/d' >> ReleaseNotes.md
if: github.event_name != 'pull_request'
- name: Delete Old Pre-Release
uses: dev-drprasad/[email protected]
with:
tag_name: ${{ env.OLD_PRE_TAG }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
if: github.event_name != 'pull_request'
- name: Publish GitHub Release
uses: ncipollo/[email protected]
with:
name: "bpn v1.4-alpha ${{ env.SHORT_SHA }}"
prerelease: true
draft: false
bodyFile: 'ReleaseNotes.md'
tag: "v1.4-alpha"
token: ${{ secrets.GITHUB_TOKEN }}
artifacts: "SSBPN-1.4-alpha.jar"
generateReleaseNotes: true
if: github.event_name != 'pull_request'
- name: Upload to Artifacts
uses: actions/[email protected]
with:
name: Release Artifacts
path: "SSBPN-1.4-alpha.jar"
- name: Clean project
run: npm run clean