forked from jverein/jverein
-
Notifications
You must be signed in to change notification settings - Fork 17
99 lines (81 loc) · 2.87 KB
/
nightly-builds.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
# This workflow will build a Java project with Ant
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-java-with-ant
name: openjverein nightly release
on:
push:
branches:
- master
tags-ignore:
- '**'
jobs:
build:
name: Building release and upload to branch
runs-on: ubuntu-latest
steps:
- name: Set up JDK 11 for x64
uses: actions/setup-java@v3
with:
java-version: '11'
distribution: 'temurin'
architecture: x64
- name: Check out jameica
uses: actions/checkout@v4
with:
repository: willuhn/jameica
path: jameica
- name: Build jameica nightly
working-directory: ./
run: ant -noinput -buildfile jameica/build/build.xml nightly
- name: Check out hibiscus
uses: actions/checkout@v4
with:
repository: willuhn/hibiscus
path: hibiscus
- name: Build hibiscus nightly
working-directory: ./
run: ant -noinput -buildfile hibiscus/build/build.xml nightly
- name: Checkout openjverein
id: openjverein_checkout
uses: actions/checkout@v4
with:
path: jverein
- name: Build openjverein plugin
id: openjverein
working-directory: ./
run: |
ant_output=$(ant -e -q -noinput -buildfile jverein/build/build.xml nightly)
echo $ant_output
ssa="SELECTED_VERSION="
ssb=".zip"
text="${ant_output#*${ssa}}"
text="${text%${ssb}*}.zip"
tmp_version=$(echo $text | sed -rn 's/^([^[:blank:]]*).*$/\1/p')
tmp_version=$tmp_version
ssa="SELECTED_FILENAME="
text="${ant_output#*${ssa}}"
text="${text%${ssb}*}.zip"
tmp_filename=$(echo $text | sed -rn 's/^([^[:blank:]]*).*$/\1/p')
ssa="SELECTED_PATH="
text="${ant_output#*${ssa}}"
text="${text%${ssb}*}.zip"
tmp_path=$(echo $text | sed -rn 's/^([^[:blank:]]*).*$/\1/p')
echo "selected_version=${tmp_version}" >> $GITHUB_OUTPUT
echo "selected_filename=$tmp_filename" >> $GITHUB_OUTPUT
echo "selected_path=$tmp_path" >> $GITHUB_OUTPUT
builddatetime=$(date +'%Y-%m-%d %H:%M')
echo "### Version: $tmp_version | filename: $tmp_filename | build datetime: $builddatetime" >> $GITHUB_STEP_SUMMARY
# Update tag
- name: Tag repo
uses: richardsimko/update-tag@v1
with:
tag_name: ${{ steps.openjverein.outputs.selected_version }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Release
uses: softprops/action-gh-release@v2
with:
tag_name: ${{ steps.openjverein.outputs.selected_version }}
prerelease: true
name: Release ${{ steps.openjverein.outputs.selected_version }}
files: ./jverein/${{ steps.openjverein.outputs.selected_path }}
generate_release_notes: false