-
Notifications
You must be signed in to change notification settings - Fork 2
108 lines (108 loc) · 3 KB
/
create_release.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
108
name: "Create Release"
on:
workflow_dispatch:
push:
branches:
- "main"
permissions:
contents: read
jobs:
build:
name: Build SpringBooot-Jar
runs-on: ubuntu-latest
permissions:
contents: read
- name: Build bootJar
run: |
./gradlew :monitor:bootJar
- name: Upload Artifact
uese: actions/upload-artifact@v4
with:
name: bootjar
path: monitor/build/libs/monitor.jar
if-no-files-found: error
overwrite: true
release:
name: Generate Release
runs-on: ubuntu-latest
needs:
- build
permissions:
contents: write
issues: write
pull-requests: write
outputs:
release_tag: ${{ steps.release.outputs.tag }}
steps:
- name: Checkout Repository
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Get SpringBoot-Jar
uses: actions/download-artifact@v4
with:
name: bootjar
path: monitor/build/libs/
- name: Install Node.js
uses: actions/setup-node@v4
with:
cache: npm
node-version: "lts/*"
- name: Install NodeJS Dependencies
run: npm clean-install
- name: Verify the integrity and registry signatures for dependencies
run: npm audit signatures
- name: Create Release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: npx semantic-release
- name: Get Release Version
id: release
uses: GuillaumeFalourd/get-release-or-tag@v2
publish_package:
name: Publish runtime as Maven Package
runs-on: ubuntu-latest
needs:
- release
permissions:
- packages: write
steps:
- name: Checkout Repository
uses: actions/checkout@v4
- name: Push Package
env:
ACTOR: ${{ github.actor }}
TOKEN: ${{ secrets.GITHUB_TOKEN }}
TAG: ${{ needs.release.outputs.release_tag }}
run: |
./gradlew -Pversion=$TAG :runtime:publish
publish_container_image:
name: Publish Monitor as Container Image
runs-on: ubuntu-latest
needs:
- release
permissions:
- packages: write
steps:
- name: Checkout Repository
uses: actions/checkout@v4
- name: Get SpringBoot-Jar
uses: actions/download-artifact@v4
with:
name: bootjar
path: monitor/build/libs/
- name: Build Monitor Image
working-directory: ./monitor
env:
RELEASE: ${{ needs.release.outputs.release_tag }}
run: |
docker build --file Dockerfile --tag ghcr.io/$GITHUB_REPOSITORY:$RELEASE --tag ghcr.io/$GITHUB_REPOSITORY:latest .
- name: Login to Github Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Push Image to Github Container Registry
run: |
docker push --all-tags ghcr.io/$GITHUB_REPOSITORY