Skip to content

Migrate to GH actions #291

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 8 commits into from
Mar 22, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
42 changes: 21 additions & 21 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -111,24 +111,24 @@ workflows:
filters:
tags:
only: /.*/
- release-maven-publish:
context:
- hypertrace-publishing
- maven-central-publish
requires:
- build
- muzzle
filters:
branches:
ignore: /.*/
tags:
only: /^[0-9]+\.[0-9]+\.[0-9]+/
- release-github-publish:
context: hypertrace-publishing
requires:
- release-maven-publish
filters:
branches:
ignore: /.*/
tags:
only: /^[0-9]+\.[0-9]+\.[0-9]+/
# - release-maven-publish:
# context:
# - hypertrace-publishing
# - maven-central-publish
# requires:
# - build
# - muzzle
# filters:
# branches:
# ignore: /.*/
# tags:
# only: /^[0-9]+\.[0-9]+\.[0-9]+/
# - release-github-publish:
# context: hypertrace-publishing
# requires:
# - release-maven-publish
# filters:
# branches:
# ignore: /.*/
# tags:
# only: /^[0-9]+\.[0-9]+\.[0-9]+/
66 changes: 66 additions & 0 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
name: build
on:
push:
branches:
- main
paths-ignore:
- '**/README.md'
- 'smoke-tests/matrix'
pull_request:

jobs:
build:
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
muzzle:
runs-on: ubuntu-20.04
steps:
- 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: muzzle
run: make muzzle
env:
JVM_OPTS: -Xmx1g
TERM: dumb
50 changes: 50 additions & 0 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
name: release
on:
create:
tags:
- ^[0-9]+\.[0-9]+\.[0-9]+

jobs:
release:
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

- name: publish to maven
run: ./gradlew publish closeAndReleaseRepository
env:
JVM_OPTS: -Xmx1g
TERM: dumb

- name: Set release version env
run: echo "RELEASE_VERSION=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV

- name: Create github release
uses: fnkr/github-action-ghr@v1
run: ls ./javaagent/build/libs && ghr -t ${GITHUB_TOKEN} -u hypertrace -r javaagent -n "Release ${RELEASE_VERSION}" -b "..." --soft ${RELEASE_VERSION} ./artifacts/
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: test
name: smoke-test
on:
push:
branches:
Expand Down Expand Up @@ -36,4 +36,4 @@ jobs:
run: make smoke-test
env:
JVM_OPTS: -Xmx1g
TERM: dumb
TERM: dumb