-
Notifications
You must be signed in to change notification settings - Fork 1
93 lines (82 loc) · 2.92 KB
/
main.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
name: CI Build
on:
push:
branches: [ main ]
jobs:
build:
name: Build
runs-on: ubuntu-latest
timeout-minutes: 15
permissions:
contents: write
steps:
- name: Code Checkout
uses: actions/checkout@v4
- name: Setup Java
uses: actions/setup-java@v4
with:
distribution: 'adopt'
java-version: '21'
- name: Get Gradle Version
run: |
echo "TAGS=latest" >> $GITHUB_ENV
SUFFIX=""
VERSION=$(grep 'version =' build.gradle.kts | cut -f 2 -d '"')$SUFFIX
echo "VERSION=$VERSION" >> $GITHUB_ENV
REPO=$(echo $GITHUB_REPOSITORY | cut -f 2 -d "/")
echo "REPO=$REPO" >> $GITHUB_ENV
echo "OWNER=$GITHUB_REPOSITORY_OWNER" >> $GITHUB_ENV
- name: Check if version is used
run: |
URL=$GITHUB_API_URL/repos/$GITHUB_REPOSITORY/releases/tags/${{ env.VERSION }}
echo "$URL"
CODE=$(curl -s -o /dev/null -w "%{http_code}" "$URL")
if [ "$CODE" != 404 ]; then
echo "Release '$VERSION' already exists. ($CODE)"
exit 1
fi
- name: Generating self-signed certificate
run: |
openssl req \
-newkey rsa:2048 \
-new \
-nodes \
-x509 \
-days 3650 \
-keyout key.pem \
-out cert.pem \
-subj "/C=US/ST=SC/L=Hometown/O=IT/emailAddress=root@localhost/CN=localhost"
- name: Test & Build
run: |
./gradlew build --no-daemon \
-Dquarkus.package.type=native \
-Dquarkus.native.container-build=true \
-Dquarkus.container-image.build=true \
-Dquarkus.container-image.push=true \
-Dquarkus.container-image.username=${{ env.OWNER }} \
-Dquarkus.container-image.password=${{ secrets.DOCKER_TOKEN }} \
-Dquarkus.container-image.group=${{ env.OWNER }} \
-Dquarkus.container-image.name=${{ env.REPO }} \
-Dquarkus.container-image.tag=${{ env.VERSION }} \
-Dquarkus.container-image.additional-tags=${{ env.TAGS }}
- name: Creating GitHub Tag
uses: mathieudutour/[email protected]
with:
custom_tag: ${{ env.VERSION }}
tag_prefix: ''
github_token: ${{ secrets.GITHUB_TOKEN }}
- name: Create GitHub Release
uses: ncipollo/release-action@v1
with:
tag: ${{ env.VERSION }}
token: ${{ secrets.GITHUB_TOKEN }}
- name: Overwrite Coverage Theme
run: |
/bin/cp -rf helpers/jacoco-report/* build/jacoco-report/.
/bin/cp -f README.md build/jacoco-report/.
- name: Publishing to GitHub Pages
uses: peaceiris/actions-gh-pages@v4
with:
publish_dir: ./build/jacoco-report
github_token: ${{ secrets.GITHUB_TOKEN }}
cname: httpbucket.testainers.com