-
Notifications
You must be signed in to change notification settings - Fork 8
93 lines (89 loc) · 3.42 KB
/
eumserver_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
name: Release Eum Server
on:
push:
tags:
- '[0-9]*.[0-9]*.[0-9]**'
jobs:
test_eum_server:
uses: ./.github/workflows/eumserver_test.yml
build_and_release:
name: Build and release EUM Server
runs-on: ubuntu-latest
needs: [test_eum_server] #test
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Grant execute permission for gradlew
run: chmod +x gradlew
- name: Build project
run: ./gradlew assemble bootJar -PbuildVersion=${{ github.ref_name }}
- name: Create BOM
run: ./gradlew cyclonedxBom
- name: Add artifacts
run: |
mkdir artifacts
cp build/libs/*.jar ./artifacts
cp build/reports/bom.json ./artifacts
cp build/reports/bom.xml ./artifacts
- name: Generate Release Hashes
run: |
cd ./artifacts
sha256sum * >> inspectit-ocelot-eum-server-sha256-checksums.txt
# Uploading eumserver jar, for creating docker image in the next step
- name: Upload eumserver jar
uses: actions/upload-artifact@v3
with:
name: eumserver-jar
path: artifacts/inspectit-ocelot-eum-server-${{ github.ref_name }}.jar
- name: "Build Changelog"
id: build_changelog
uses: mikepenz/release-changelog-builder-action@v3.5.0
with:
# Config for the Changelog, reference: https://github.com/marketplace/actions/release-changelog-builder
configuration: ".github/workflows/eumserver-release-config.json"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Create Release
uses: softprops/action-gh-release@v0.1.15
with:
tag_name: ${{ github.ref_name }}
body: ${{ steps.build_changelog.outputs.changelog }}
files: artifacts/*
generate_release_notes: true
token: ${{ github.token }}
name: Version ${{ github.ref_name }}
publish_docker_image:
name: "Publish docker image"
runs-on: ubuntu-latest
needs: [build_and_release]
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Download eumserver jar
uses: actions/download-artifact@v3
with:
name: eumserver-jar # with the name we are referencing the eumserver-jar uploaded in the build_and_release job
path: docker/
- name: Check if jar exists and rename it
run: |
cd docker
mv inspectit-ocelot-eum-server-${{ github.ref_name }}.jar inspectit-ocelot-eum-server.jar
ls
- name: Set up QEMU
uses: docker/setup-qemu-action@v2
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Login to Docker Hub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKER_HUB_USER }}
password: ${{ secrets.DOCKER_HUB_PASSWORD }}
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Build and push image
uses: docker/build-push-action@v3
with:
context: .
push: true
tags: inspectit/inspectit-ocelot-eum-server:${{ github.ref_name }}, inspectit/inspectit-ocelot-eum-server:latest
file: ./docker/Dockerfile