-
Notifications
You must be signed in to change notification settings - Fork 8
77 lines (73 loc) · 2.52 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
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]
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
- name: "Get previous tag"
id: previoustag
# this gets the tag of the previous release based on the tags in the repo
run: echo "tag=$(git ls-remote --tags | cut --delimiter='/' --fields=3 | tail --lines=2 | head -n -1)" >> $GITHUB_OUTPUT
- name: "Build Changelog"
id: build_changelog
uses: danipaniii/action-github-changelog-generator@v1.2
with:
token: ${{ secrets.GITHUB_TOKEN }}
sinceTag: ${{ steps.previoustag.outputs.tag }}
dateFormat:
maxIssues: 500
unreleased: false
author: false
headerLabel: "## Changelog"
stripGeneratorNotice: true
- 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: false
token: ${{ github.token }}
name: Version ${{ github.ref_name }}
build_and_publish_docker_images:
name: "Build and Push Docker Images"
runs-on: ubuntu-latest
needs: build_and_release
environment: release
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Grant execute permission for gradlew
run: chmod +x gradlew
- name: Build Docker Images
run: ./gradlew dockerTag -PbuildVersion=${{ github.ref_name }}
- name: Push Docker Images
run: |
docker login -u ${{ secrets.DOCKER_HUB_USER }} -p ${{ secrets.DOCKER_HUB_PASSWORD }}
docker push inspectit/inspectit-ocelot-eum-server:${{ github.ref_name }}
docker push inspectit/inspectit-ocelot-eum-server:latest