-
Notifications
You must be signed in to change notification settings - Fork 868
98 lines (84 loc) · 3.89 KB
/
build.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
name: Build
on:
push:
branches:
- main
- release/*
workflow_dispatch:
jobs:
common:
uses: ./.github/workflows/build-common.yml
secrets:
GRADLE_ENTERPRISE_ACCESS_KEY: ${{ secrets.GRADLE_ENTERPRISE_ACCESS_KEY }}
test-latest-deps:
# release branches are excluded
# because any time a new library version is released to maven central it can fail
# which requires unnecessary release branch maintenance, especially for patches
if: "!startsWith(github.ref_name, 'release/')"
uses: ./.github/workflows/reusable-test-latest-deps.yml
secrets:
GRADLE_ENTERPRISE_ACCESS_KEY: ${{ secrets.GRADLE_ENTERPRISE_ACCESS_KEY }}
muzzle:
# release branches are excluded
# because any time a new library version is released to maven central it can fail
# which requires unnecessary release branch maintenance, especially for patches
if: "!startsWith(github.ref_name, 'release/')"
uses: ./.github/workflows/reusable-muzzle.yml
shell-script-check:
# release branches are excluded to avoid unnecessary maintenance if new shell checks are added
if: "!startsWith(github.ref_name, 'release/')"
uses: ./.github/workflows/reusable-shell-script-check.yml
markdown-link-check:
# release branches are excluded to avoid unnecessary maintenance if external links break
# (and also because the README.md javaagent download link has to be updated on release branches
# before the release download has been published)
if: "!startsWith(github.ref_name, 'release/')"
uses: ./.github/workflows/reusable-markdown-link-check.yml
markdown-lint-check:
# release branches are excluded
if: "!startsWith(github.ref_name, 'release/')"
uses: ./.github/workflows/reusable-markdown-lint-check.yml
misspell-check:
# release branches are excluded to avoid unnecessary maintenance if new misspellings are added
# to the misspell dictionary
if: "!startsWith(github.ref_name, 'release/')"
uses: ./.github/workflows/reusable-misspell-check.yml
publish-snapshots:
needs:
# intentionally not blocking snapshot publishing on test-latest-deps, muzzle,
# markdown-link-check, or misspell-check
- common
runs-on: ubuntu-latest
# skipping release branches because the versions in those branches are not snapshots
if: github.ref_name == 'main' && github.repository == 'open-telemetry/opentelemetry-java-instrumentation'
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- name: Free disk space
run: .github/scripts/gha-free-disk-space.sh
- name: Set up JDK for running Gradle
uses: actions/setup-java@8df1039502a15bceb9433410b1a100fbe190c53b # v4.5.0
with:
distribution: temurin
java-version-file: .java-version
- name: Setup Gradle
uses: gradle/actions/setup-gradle@473878a77f1b98e2b5ac4af93489d1656a80a5ed # v4.2.0
with:
# gradle enterprise is used for the build cache
gradle-home-cache-excludes: caches/build-cache-1
- name: Build and publish artifact snapshots
env:
GRADLE_ENTERPRISE_ACCESS_KEY: ${{ secrets.GRADLE_ENTERPRISE_ACCESS_KEY }}
SONATYPE_USER: ${{ secrets.SONATYPE_USER }}
SONATYPE_KEY: ${{ secrets.SONATYPE_KEY }}
GPG_PRIVATE_KEY: ${{ secrets.GPG_PRIVATE_KEY }}
GPG_PASSWORD: ${{ secrets.GPG_PASSWORD }}
run: ./gradlew assemble spdxSbom publishToSonatype
- name: Build and publish gradle plugin snapshots
env:
GRADLE_ENTERPRISE_ACCESS_KEY: ${{ secrets.GRADLE_ENTERPRISE_ACCESS_KEY }}
SONATYPE_USER: ${{ secrets.SONATYPE_USER }}
SONATYPE_KEY: ${{ secrets.SONATYPE_KEY }}
GPG_PRIVATE_KEY: ${{ secrets.GPG_PRIVATE_KEY }}
GPG_PASSWORD: ${{ secrets.GPG_PASSWORD }}
run: ./gradlew build publishToSonatype
working-directory: gradle-plugins