-
Notifications
You must be signed in to change notification settings - Fork 71
Expand file tree
/
Copy pathaction.yml
More file actions
121 lines (109 loc) · 4.71 KB
/
Copy pathaction.yml
File metadata and controls
121 lines (109 loc) · 4.71 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
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
121
name: "Patch dependencies"
description: |
Patches direct dependencies of this project leveraging maven local to publish the results.
This workflow supports patching opentelemetry-java and opentelemetry-java-contrib repositories by executing
the `patch.sh` script that will try to patch those repositories and after that will optionally test and then publish
the artifacts to maven local.
To add a patch you have to add a file in the `.github/patches/` directory with the name of the repository that must
be patched.
This action assumes that java was set correctly.
inputs:
run_tests:
default: "false"
required: false
description: "If the workflow should run tests of the dependencies. Anything different than false will evaluate to true"
gpg_private_key:
description: "The gpg key used to sign the artifacts"
required: false
gpg_password:
description: "The gpg key password"
required: false
runs:
using: "composite"
steps:
- name: set environment variables
env:
INPUT_KEY: ${{ inputs.gpg_private_key }}
INPUT_PASSWORD: ${{ inputs.gpg_password }}
shell: bash
run: |
EOF=$(dd if=/dev/urandom bs=15 count=1 status=none | base64)
if [[ ! -z "$INPUT_KEY" ]]; then
{
echo "GPG_PRIVATE_KEY<<$EOF"
echo "$INPUT_KEY"
echo "$EOF"
} >> "$GITHUB_ENV"
fi
if [[ ! -z "$INPUT_PASSWORD" ]]; then
{
echo "GPG_PASSWORD<<$EOF"
echo "$INPUT_PASSWORD"
echo "$EOF"
} >> "$GITHUB_ENV"
fi
- name: check patches
run: |
if [[ -f .github/patches/opentelemetry-java.patch ]]; then
echo 'patch_otel_java=true' >> $GITHUB_ENV
fi
if [[ -f .github/patches/opentelemetry-java-instrumentation.patch ]]; then
echo 'patch_otel_java_instrumentation=true' >> $GITHUB_ENV
fi
if [[ -f .github/patches/opentelemetry-java-contrib.patch ]]; then
echo 'patch_otel_java_contrib=true' >> $GITHUB_ENV
fi
shell: bash
- name: Clone and patch repositories
run: .github/scripts/patch.sh
if: ${{ env.patch_otel_java == 'true' ||
env.patch_otel_java_contrib == 'true' }}
shell: bash
- name: Build opentelemetry-java with tests
uses: gradle/gradle-build-action@a8f75513eafdebd8141bd1cd4e30fcd194af8dfa #v2
if: ${{ env.patch_otel_java == 'true' && inputs.run_tests != 'false' }}
with:
arguments: build publishToMavenLocal
build-root-directory: opentelemetry-java
- name: Build opentelemetry-java
uses: gradle/gradle-build-action@a8f75513eafdebd8141bd1cd4e30fcd194af8dfa #v2
if: ${{ env.patch_otel_java == 'true' && inputs.run_tests == 'false' }}
with:
arguments: publishToMavenLocal
build-root-directory: opentelemetry-java
- name: cleanup opentelemetry-java
run: rm -rf opentelemetry-java
if: ${{ env.patch_otel_java == 'true' }}
shell: bash
- name: Build opentelemetry-java-contrib with tests
uses: gradle/gradle-build-action@a8f75513eafdebd8141bd1cd4e30fcd194af8dfa #v2
if: ${{ env.patch_otel_java_contrib == 'true' && inputs.run_tests != 'false' }}
with:
arguments: build publishToMavenLocal
build-root-directory: opentelemetry-java-contrib
- name: Build opentelemetry-java-contrib
uses: gradle/gradle-build-action@a8f75513eafdebd8141bd1cd4e30fcd194af8dfa #v2
if: ${{ env.patch_otel_java_contrib == 'true' && inputs.run_tests == 'false' }}
with:
arguments: publishToMavenLocal
build-root-directory: opentelemetry-java-contrib
- name: cleanup opentelemetry-java-contrib
run: rm -rf opentelemetry-java-contrib
if: ${{ env.patch_otel_java_contrib == 'true' }}
shell: bash
- name: Build opentelemetry-java-instrumentation with tests
uses: gradle/gradle-build-action@a8f75513eafdebd8141bd1cd4e30fcd194af8dfa #v2
if: ${{ env.patch_otel_java_instrumentation == 'true' && inputs.run_tests != 'false' }}
with:
arguments: check -x spotlessCheck publishToMavenLocal
build-root-directory: opentelemetry-java-instrumentation
- name: Build opentelemetry java instrumentation
uses: gradle/gradle-build-action@a8f75513eafdebd8141bd1cd4e30fcd194af8dfa #v2
if: ${{ env.patch_otel_java_instrumentation == 'true' && inputs.run_tests == 'false' }}
with:
arguments: publishToMavenLocal
build-root-directory: opentelemetry-java-instrumentation
- name: cleanup opentelmetry-java-instrumentation
run: rm -rf opentelemetry-java-instrumentation
if: ${{ env.patch_otel_java_instrumentation == 'true' }}
shell: bash