-
Notifications
You must be signed in to change notification settings - Fork 15
120 lines (106 loc) · 3.92 KB
/
release.yaml
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: release
on:
push:
tags: ['[0-9]+\.[0-9]+\.[0-9]+']
jobs:
test:
runs-on: ubuntu-20.04
steps:
# Set fetch-depth: 0 to fetch commit history and tags for use in version calculation
- name: Check out code
uses: actions/[email protected]
with:
fetch-depth: 0
submodules: true
- name: create checksum file
uses: hypertrace/github-actions/checksum@main
- name: Cache packages
id: cache-packages
uses: actions/cache@v2
with:
path: ~/.gradle
key: gradle-packages-${{ runner.os }}-${{ github.job }}-${{ hashFiles('**/checksum.txt') }}
restore-keys: |
gradle-packages-${{ runner.os }}-${{ github.job }}
gradle-packages-${{ runner.os }}
- name: build
run: make build
env:
JVM_OPTS: -Xmx1g
TERM: dumb
smoke-test:
runs-on: ubuntu-20.04
strategy:
matrix:
suite: [ "glassfish", "jetty", "liberty", "tomcat", "tomee", "wildfly", "other" ]
fail-fast: true
steps:
# Set fetch-depth: 0 to fetch commit history and tags for use in version calculation
- name: Check out code
uses: actions/[email protected]
with:
fetch-depth: 0
submodules: true
- name: create checksum file
uses: hypertrace/github-actions/checksum@main
- name: Cache packages
id: cache-packages
uses: actions/cache@v2
with:
path: ~/.gradle
key: gradle-packages-${{ runner.os }}-${{ github.job }}-${{ hashFiles('**/checksum.txt') }}
restore-keys: |
gradle-packages-${{ runner.os }}-${{ github.job }}
gradle-packages-${{ runner.os }}
- name: smoke-test
run: make smoke-test SMOKE_TEST_SUITE=${{ matrix.suite }}
env:
JVM_OPTS: -Xmx1g
TERM: dumb
release:
needs: [ test, smoke-test ]
runs-on: ubuntu-20.04
steps:
# Set fetch-depth: 0 to fetch commit history and tags for use in version calculation
- name: Check out code
uses: actions/[email protected]
with:
fetch-depth: 0
submodules: true
- name: create checksum file
uses: hypertrace/github-actions/checksum@main
- name: Cache packages
id: cache-packages
uses: actions/cache@v2
with:
path: ~/.gradle
key: gradle-packages-${{ runner.os }}-${{ github.job }}-${{ hashFiles('**/checksum.txt') }}
restore-keys: |
gradle-packages-${{ runner.os }}-${{ github.job }}
gradle-packages-${{ runner.os }}
- name: Release jars
run: |
echo "Releasing version:" && ./gradlew printVersion clean
ORG_GRADLE_PROJECT_signingKey=$(echo $SIGNING_KEY | base64 -d) ./gradlew publish
./gradlew closeAndReleaseRepository
env:
JVM_OPTS: -Xmx1g
TERM: dumb
ORG_GRADLE_PROJECT_ossrhUsername: ${{ secrets.ORG_GRADLE_PROJECT_OSSRHUSERNAME }}
ORG_GRADLE_PROJECT_ossrhPassword: ${{ secrets.ORG_GRADLE_PROJECT_OSSRHPASSWORD }}
ORG_GRADLE_PROJECT_signingKeyId: ${{ secrets.ORG_GRADLE_PROJECT_SIGNINGKEYID }}
ORG_GRADLE_PROJECT_signingPassword: ${{ secrets.ORG_GRADLE_PROJECT_SIGNINGPASSWORD }}
SIGNING_KEY: ${{ secrets.MAVEN_SIGNING_KEY }}
- name: Release docker image
run: |
echo $DOCKER_PASSWORD | docker login --username $DOCKER_USERNAME --password-stdin
DOCKER_TAG=${GITHUB_REF##*/} make docker docker-push
env:
DOCKER_USERNAME: ${{ secrets.DOCKERHUB_PUBLISH_USER }}
DOCKER_PASSWORD: ${{ secrets.DOCKERHUB_PUBLISH_TOKEN }}
- name: Upload jars to release page
run: |
export TAG=${GITHUB_REF##*/}
gh release create ${TAG} --title "Release ${TAG}" javaagent/build/libs/*-all.jar
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}