forked from getsentry/sentry-java
-
Notifications
You must be signed in to change notification settings - Fork 0
95 lines (83 loc) · 2.79 KB
/
build.yml
File metadata and controls
95 lines (83 loc) · 2.79 KB
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
name: "Workflow Ubuntu macOS"
on:
push:
branches:
- main
pull_request:
branches:
- '*'
jobs:
build:
name: Build Job ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
# we want that the matrix keeps running, default is to cancel them if it fails.
fail-fast: false
matrix:
# TODO: windows-latest
os: [ubuntu-latest, macos-latest]
steps:
- name: Git checkout
uses: actions/checkout@v2
# Zulu Community distribution of OpenJDK
- name: set up JDK 1.8
uses: actions/setup-java@v1
with:
java-version: 1.8
# use sequential key when bumping dependencies till single lock file is out of preview
# https://docs.gradle.org/current/userguide/dependency_locking.html#single_lock_file_per_project
- name: Cache Gradle Caches
uses: actions/cache@v1
with:
path: ~/.gradle/caches/
key: cache-gradle-cache-3
- name: Cache Gradle Wrapper
uses: actions/cache@v1
with:
path: ~/.gradle/wrapper/
key: cache-gradle-wrapper-3
# Clean, check formatting, build and do a dry release
- name: Make all
run: make all
# We stop gradle at the end to make sure the cache folders
# don't contain any lock files and are free to be cached.
- name: Make stop
run: make stop
- name: Archive packages
# We need artifacts from only one the builds
if: runner.os == 'Linux'
uses: actions/upload-artifact@v2
with:
name: ${{ github.sha }}
path: ./*/build/distributions/*.zip
- name: Upload coverage to Codecov
# We need coverage data from only one the builds
if: runner.os == 'Linux'
uses: codecov/codecov-action@v1
with:
name: sentry-java
release:
## Only run on a release branch
if: github.event_name == 'push' && contains(github.ref, 'refs/heads/release')
needs: [build]
name: Release
runs-on: ubuntu-latest
steps:
- name: Download packages
uses: actions/download-artifact@v2
with:
name: artifacts
path: ./*/build/distributions/*.zip
- uses: actions/setup-node@v1
- name: Install Zeus
run: |
yarn global add @zeus-ci/cli
echo "::add-path::$(yarn global bin)"
- name: Upload to Zeus
env:
ZEUS_API_TOKEN: ${{ secrets.ZEUS_TOKEN }}
ZEUS_HOOK_BASE: ${{ secrets.ZEUS_HOOK_BASE }}
run: |
zeus job update -b $GITHUB_RUN_ID -j $GITHUB_RUN_NUMBER -r $GITHUB_SHA
zeus upload -b $GITHUB_RUN_ID -j $GITHUB_RUN_NUMBER -t "application/zip+maven" *.zip
zeus job update --status=passed -b $GITHUB_RUN_ID -j $GITHUB_RUN_NUMBER -r $GITHUB_SHA