Skip to content

Commit c415f52

Browse files
authored
Remove CCI and add release GHA release workflow (#333)
* Remove CCI and add release GHA release workflow Signed-off-by: Pavol Loffay <[email protected]> * Fix Signed-off-by: Pavol Loffay <[email protected]> * Fix Signed-off-by: Pavol Loffay <[email protected]> * Fix Signed-off-by: Pavol Loffay <[email protected]> * enable others Signed-off-by: Pavol Loffay <[email protected]>
1 parent 168a449 commit c415f52

File tree

5 files changed

+96
-192
lines changed

5 files changed

+96
-192
lines changed

.circleci/config.yml

-134
This file was deleted.

.github/workflows/release.yaml

+90-38
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,73 @@
11
name: release
22
on:
33
create:
4-
tags:
5-
- ^[0-9]+\.[0-9]+\.[0-9]+
4+
tags: ['^[0-9]+\.[0-9]+\.[0-9]+']
65

76
jobs:
7+
test:
8+
runs-on: ubuntu-20.04
9+
steps:
10+
# Set fetch-depth: 0 to fetch commit history and tags for use in version calculation
11+
- name: Check out code
12+
uses: actions/[email protected]
13+
with:
14+
fetch-depth: 0
15+
submodules: true
16+
17+
- name: create checksum file
18+
uses: hypertrace/github-actions/checksum@main
19+
20+
- name: Cache packages
21+
id: cache-packages
22+
uses: actions/cache@v2
23+
with:
24+
path: ~/.gradle
25+
key: gradle-packages-${{ runner.os }}-${{ github.job }}-${{ hashFiles('**/checksum.txt') }}
26+
restore-keys: |
27+
gradle-packages-${{ runner.os }}-${{ github.job }}
28+
gradle-packages-${{ runner.os }}
29+
30+
- name: build
31+
run: make build
32+
env:
33+
JVM_OPTS: -Xmx1g
34+
TERM: dumb
35+
36+
smoke-test:
37+
runs-on: ubuntu-20.04
38+
strategy:
39+
matrix:
40+
suite: [ "glassfish", "jetty", "liberty", "tomcat", "tomee", "wildfly", "other" ]
41+
fail-fast: true
42+
steps:
43+
# Set fetch-depth: 0 to fetch commit history and tags for use in version calculation
44+
- name: Check out code
45+
uses: actions/[email protected]
46+
with:
47+
fetch-depth: 0
48+
submodules: true
49+
50+
- name: create checksum file
51+
uses: hypertrace/github-actions/checksum@main
52+
53+
- name: Cache packages
54+
id: cache-packages
55+
uses: actions/cache@v2
56+
with:
57+
path: ~/.gradle
58+
key: gradle-packages-${{ runner.os }}-${{ github.job }}-${{ hashFiles('**/checksum.txt') }}
59+
restore-keys: |
60+
gradle-packages-${{ runner.os }}-${{ github.job }}
61+
gradle-packages-${{ runner.os }}
62+
63+
- name: smoke-test
64+
run: make smoke-test SMOKE_TEST_SUITE=${{ matrix.suite }}
65+
env:
66+
JVM_OPTS: -Xmx1g
67+
TERM: dumb
68+
869
release:
70+
needs: [ test, smoke-test ]
971
runs-on: ubuntu-20.04
1072
steps:
1173
# Set fetch-depth: 0 to fetch commit history and tags for use in version calculation
@@ -28,41 +90,31 @@ jobs:
2890
gradle-packages-${{ runner.os }}-${{ github.job }}
2991
gradle-packages-${{ runner.os }}
3092
31-
# - name: build
32-
# run: make build
33-
# env:
34-
# JVM_OPTS: -Xmx1g
35-
# TERM: dumb
93+
- name: Release jars
94+
run: |
95+
echo "Releasing version:" && ./gradlew printVersion clean
96+
ORG_GRADLE_PROJECT_signingKey=$(echo $SIGNING_KEY | base64 -d) ./gradlew publish
97+
./gradlew closeAndReleaseRepository
98+
env:
99+
JVM_OPTS: -Xmx1g
100+
TERM: dumb
101+
ORG_GRADLE_PROJECT_ossrhUsername: ${{ secrets.ORG_GRADLE_PROJECT_OSSRHUSERNAME }}
102+
ORG_GRADLE_PROJECT_ossrhPassword: ${{ secrets.ORG_GRADLE_PROJECT_OSSRHPASSWORD }}
103+
ORG_GRADLE_PROJECT_signingKeyId: ${{ secrets.ORG_GRADLE_PROJECT_SIGNINGKEYID }}
104+
ORG_GRADLE_PROJECT_signingPassword: ${{ secrets.ORG_GRADLE_PROJECT_SIGNINGPASSWORD }}
105+
SIGNING_KEY: ${{ secrets.MAVEN_SIGNING_KEY }}
36106

37-
# - name: Set signing key
38-
# run: echo "ORG_GRADLE_PROJECT_signingKey=$(echo $SIGNING_KEY | base64 -d)" >> $GITHUB_ENV
39-
# env:
40-
# SIGNING_KEY: ${{ secrets.MAVEN_SIGNING_KEY }}
41-
#
42-
# - name: Print signing key
43-
# run: echo $ORG_GRADLE_PROJECT_signingKey
107+
- name: Release docker image
108+
run: |
109+
echo $DOCKER_PASSWORD | docker login --username $DOCKER_USERNAME --password-stdin
110+
DOCKER_TAG=${GITHUB_REF##*/} make docker docker-push
111+
env:
112+
DOCKER_USERNAME: ${{ secrets.DOCKERHUB_PUBLISH_USER }}
113+
DOCKER_PASSWORD: ${{ secrets.DOCKERHUB_PUBLISH_TOKEN }}
44114

45-
# - name: publish to maven
46-
# run: ./gradlew publish closeAndReleaseRepository
47-
# env:
48-
# JVM_OPTS: -Xmx1g
49-
# TERM: dumb
50-
# ORG_GRADLE_PROJECT_ossrhUsername: ${{ secrets.ORG_GRADLE_PROJECT_OSSRHUSERNAME }}
51-
# ORG_GRADLE_PROJECT_ossrhPassword: ${{ secrets.ORG_GRADLE_PROJECT_OSSRHPASSWORD }}
52-
# ORG_GRADLE_PROJECT_signingKeyId: ${{ secrets.ORG_GRADLE_PROJECT_SIGNINGKEYID }}
53-
# ORG_GRADLE_PROJECT_signingPassword: ${{ secrets.ORG_GRADLE_PROJECT_SIGNINGPASSWORD }}
54-
# SIGNING_KEY: ${{ secrets.MAVEN_SIGNING_KEY }}
55-
# ORG_GRADLE_PROJECT_signingKey: ${{ secrets.MAVEN_SIGNING_KEY }}
56-
#
57-
# - name: Set release version env
58-
# run: echo "RELEASE_VERSION=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV
59-
#
60-
# - name: List build artifacts
61-
# run: ls ./javaagent/build/libs
62-
#
63-
# - name: Create github release
64-
# uses: fnkr/github-action-ghr@v1
65-
# if: startsWith(github.ref, 'refs/tags/')
66-
# env:
67-
# GHR_PATH: ./javaagent/build/libs
68-
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
115+
- name: Upload jars to release page
116+
run: |
117+
export TAG=${GITHUB_REF##*/}
118+
gh release create ${TAG} --title "Release ${TAG}" javaagent/build/libs/*-all.jar
119+
env:
120+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

README.md

-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
[![CircleCI](https://circleci.com/gh/hypertrace/javaagent.svg?style=svg&circle-token=b562d40d95cc5906f445004c4a96b666250d260b)](https://circleci.com/gh/hypertrace/javaagent)
2-
31
# Hypertrace OpenTelemetry Java agent
42

53
Hypertrace distribution of [OpenTelemetry Java agent](https://github.com/open-telemetry/opentelemetry-java-instrumentation).

RELEASE.md

+5-17
Original file line numberDiff line numberDiff line change
@@ -17,23 +17,11 @@ the last tag version with `-SNAPSHOT` is used.
1717

1818
## Release CI job
1919

20-
The release CI job performs the following actions:
21-
1. creates git tag for the next version
22-
2. publishes artifacts to remove github repository with the new version
23-
3. pushes the new git tag to the origin repository
20+
The release CI job performs following actions:
21+
1. runs unit and smoke tests
22+
2. publishes java artifacts to maven repository
23+
3. publishes docker image
24+
4. creates GitHub release and uploads java agent to assets
2425

2526
Run `./gradlew publishToMavenLocal` and `ls ~/.m2/repository/org/hypertrace/agent` to find out which
2627
artifacts are being published.
27-
28-
## Configuration
29-
30-
* Add SSH key
31-
* Generate SSH key `ssh-keygen -t rsa -b 4096 -m PEM -C <email>` without passphrase
32-
* Add private key to CircleCI project settings with `github.com` domain: https://app.circleci.com/settings/project/github/hypertrace/javaagent/ssh
33-
* Add public key to Github project deploy keys and check "allow write access" https://github.com/hypertrace/javaagent/settings/keys
34-
* Add fingerprint from CircleCI project settings to `./circleci/config.yml`
35-
* Configure CI to release on `release-` tag or merge to the main branch.
36-
* Configure CI to have access to bintray. E.g. add `hypertrace-publishing` context to the publish job.
37-
* Configure gradle
38-
* Add `org.hypertrace.version-settings` [Hypertrace version plugin](https://github.com/hypertrace/hypertrace-gradle-version-settings-plugin)
39-
* Add `org.hypertrace.publish-plugin` [Hypertrace publish plugin](https://github.com/hypertrace/hypertrace-gradle-publish-plugin)

build.gradle.kts

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import org.hypertrace.gradle.publishing.License.APACHE_2_0;
33
plugins {
44
`java-library`
55
id("com.diffplug.spotless") version "5.2.0" apply false
6-
id("org.hypertrace.publish-maven-central-plugin") version "1.0.2" apply false
6+
id("org.hypertrace.publish-maven-central-plugin") version "1.0.4" apply false
77
id("org.hypertrace.ci-utils-plugin") version "0.3.0"
88
id("org.gradle.test-retry") version "1.2.0" apply false
99
}

0 commit comments

Comments
 (0)