-
Notifications
You must be signed in to change notification settings - Fork 70
120 lines (110 loc) · 5.19 KB
/
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
109
110
111
112
113
114
115
116
117
118
119
120
name: Build and Release
on:
push:
tags:
- "[0-9]*.[0-9]*.[0-9]**"
jobs:
agent_test:
uses: ./.github/workflows/agent_test.yml
configdocsgenerator_test:
uses: ./.github/workflows/configdocsgenerator_test.yml
configurationserver_test:
uses: ./.github/workflows/configurationserver_test.yml
configuration_ui_test:
uses: ./.github/workflows/configuration_ui_test.yml
build_and_release:
name: 'Build and Release'
runs-on: ubuntu-latest
environment: release
needs: [agent_test, configdocsgenerator_test, configurationserver_test, configuration_ui_test]
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Grant execute permission for gradlew
run: chmod +x gradlew
- name: Build artifacts
run: |
./gradlew assemble bootJarWithFrontend :inspectit-ocelot-core:cyclonedxBom :inspectit-ocelot-configurationserver:cyclonedxBom -PbuildVersion=${{ github.ref_name }}
mkdir artifacts
cp ./inspectit-ocelot-agent/build/inspectit-ocelot-agent-${{ github.ref_name }}.jar ./artifacts
cp ./components/inspectit-ocelot-configurationserver/build/libs/inspectit-ocelot-configurationserver-${{ github.ref_name }}.jar ./artifacts
mkdir boms
cp ./inspectit-ocelot-core/build/reports/bom.json ./boms/inspectit-ocelot-agent-bom.json
cp ./inspectit-ocelot-core/build/reports/bom.xml ./boms/inspectit-ocelot-agent-bom.xml
cp ./components/inspectit-ocelot-configurationserver/build/reports/bom.json ./boms/inspectit-ocelot-configurationserver-bom.json
cp ./components/inspectit-ocelot-configurationserver/build/reports/bom.xml ./boms/inspectit-ocelot-configurationserver-bom.xml
zip -r ./artifacts/software-bill-of-materials.zip ./boms
- name: Calculate checksums of release artifacts
working-directory: ./artifacts
run: for f in *; do sha256sum "$f" >> inspectit-ocelot-sha256-checksums.txt; done
- name: Create Release
uses: softprops/action-gh-release@v0.1.14
with:
tag_name: ${{ github.event.inputs.boomerang-version }}
files: artifacts/*
generate_release_notes: true
token: ${{ secrets.RELEASE_USER_TOKEN }}
name: Version ${{ github.ref_name }}
body: "You can also find the corresponding documentation online under the following link: [inspectIT Ocelot Documentation](http://docs.inspectit.rocks)"
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 aaronweikru/inspectit-ocelot-agent:${{ github.ref_name }}
docker push aaronweikru/inspectit-ocelot-agent:latest
docker push aaronweikru/inspectit-ocelot-configurationserver:${{ github.ref_name }}
docker push aaronweikru/inspectit-ocelot-configurationserver:latest
build_documentation:
name: "Build and Publish Release Documentation"
runs-on: ubuntu-latest
defaults:
run:
working-directory: inspectit-ocelot-documentation/website
needs: build_and_release
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Setup Node.js
uses: actions/setup-node@v2
with:
node-version: 18
cache: yarn
cache-dependency-path: 'inspectit-ocelot-documentation/website/yarn.lock'
- name: Replace Variables in Docs
working-directory: ./inspectit-ocelot-documentation/docs
run: |
find . -type f -print0 | xargs -0 sed -i 's/{inspectit-ocelot-version}/'"${{ github.ref_name }}"'/g'
OPEN_CENSUS_VERSION=$(cat ../../gradle.properties | grep -oP '(?<=openCensusVersion=).*')
find . -type f -print0 | xargs -0 sed -i 's/{opencensus-version}/'"${OPEN_CENSUS_VERSION}"'/g'
- name: Create new Documentation Version
run: |
npm install
npm run version ${{ github.ref_name }}
git add versions.json versioned_docs versioned_sidebars
git config --global user.name 'NTTechnicalUser'
git config --global user.email 'NTTechnicalUser@users.noreply.github.com'
git commit -m "Publish documentation for release ${{ github.ref_name }}"
git push origin HEAD:master
- name: Install Build Dependencies
run: yarn install --frozen-lockfile
- name: Build Website
run: yarn build
- name: Deploy to GitHub Pages
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./inspectit-ocelot-documentation/website/build/inspectit-ocelot
user_name: NTTechnicalUser
user_email: NTTechnicalUser@users.noreply.github.com
commit_message: Publish documentation for release ${{ github.ref_name }}