-
Notifications
You must be signed in to change notification settings - Fork 2
164 lines (164 loc) Β· 6.29 KB
/
main.yml
File metadata and controls
164 lines (164 loc) Β· 6.29 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
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
name: Build
on:
push:
branches-ignore:
- rebase-pull-request**
- cherry-pick-rebase-pull-request**
tags-ignore:
- '**'
jobs:
build-job:
name: "Build Linux"
runs-on: ubuntu-latest
concurrency:
group: ${{ github.ref }}-linux
env:
GH_TOKEN: ${{ secrets.TESTMINTS_PAT }}
GITHUB_TOKEN: ${{ secrets.TESTMINTS_PAT }}
ORG_GRADLE_PROJECT_signingKey: ${{ secrets.SIGNING_KEY }}
ORG_GRADLE_PROJECT_signingPassword: ${{ secrets.SIGNING_PASSWORD }}
SONATYPE_USERNAME: ${{ secrets.SONATYPE_USERNAME }}
SONATYPE_PASSWORD: ${{ secrets.SONATYPE_PASSWORD }}
outputs:
version: ${{ env.TAGGER_VERSION }}
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set Up Git User
run: |
git config user.name "github-actions[bot]"
git config user.email "6215634+robertfmurdock@users.noreply.github.com"
- uses: actions/setup-java@v4
with:
distribution: 'zulu'
java-version: '21'
- uses: testspace-com/setup-testspace@v1
if: ${{ github.ref == 'refs/heads/master' }}
with:
domain: robertfmurdock
- name: Setup Gradle
uses: gradle/actions/setup-gradle@v4
with:
cache-read-only: ${{ github.ref != 'refs/heads/master' }}
- name: Check Fingerprint π¨
continue-on-error: true
run: |
export PREVIOUS_VERSION=$(./gradlew previousVersion -q)
gh release download "$PREVIOUS_VERSION" -p "aggregate-fingerprint.txt" -O build/prev-aggregate-fingerprint.txt || true
./gradlew -q compareAggregateFingerprints \
-Pversion=$PREVIOUS_VERSION \
-PfingerprintCompareToFile=build/prev-aggregate-fingerprint.txt \
&& echo "FINGERPRINT_MATCHES_PREVIOUS=true" >> "$GITHUB_ENV" \
|| echo "FINGERPRINT_MATCHES_PREVIOUS=false" >> "$GITHUB_ENV"
- name: Diff Fingerprint Manifest π
if: ${{ env.FINGERPRINT_MATCHES_PREVIOUS == 'false' }}
continue-on-error: true
run: |
export PREVIOUS_VERSION=$(./gradlew previousVersion -q)
gh release download "$PREVIOUS_VERSION" -p "aggregate-fingerprint-manifest.log" -O build/prev-aggregate-fingerprint-manifest.log || true
diff -u build/prev-aggregate-fingerprint-manifest.log build/aggregate-fingerprint-manifest.log \
&& echo "UNEXPECTED: aggregate log matches release $PREVIOUS_VERSION"
- name: Generate Version π’
run: ./gradlew calculateVersion -PexportToGithub=true -PtaggerForceSnapshot=${{ env.FINGERPRINT_MATCHES_PREVIOUS }} --scan
- name: Build π¨
run: |
./gradlew \
assemble \
check \
-Pversion=${{ env.TAGGER_VERSION }} \
-x :plugins-test:mint-action-test:compileTestKotlinIosArm64 \
-x :plugins-test:mint-action-test:compileTestKotlinMacosArm64 \
--scan \
--no-configuration-cache \
- name: Release π
run: |
./gradlew release \
-Pversion=${{ env.TAGGER_VERSION }} \
-Pgradle.publish.key=${{ secrets.GRADLE_PUBLISH_KEY }} \
-Pgradle.publish.secret=${{ secrets.GRADLE_PUBLISH_SECRET }} \
--scan \
--no-configuration-cache
- name: Include fingerprint
continue-on-error: true
run: |
gh release upload ${{ env.TAGGER_VERSION }} \
build/aggregate-fingerprint.txt \
build/aggregate-fingerprint-manifest.log \
--clobber
- name: Update Contributions
uses: robertfmurdock/coupling-contribution-action@v3
with:
save-contribution: ${{ github.ref == 'refs/heads/master' }}
coupling-secret: ${{ secrets.COUPLING_API_PARTY_SECRET }}
party-id: 9df8b8ef-f10f-4b75-bde1-d691c148378c
contribution-file: build/digger/current.json
cycle-time-from-first-commit: true
- name: Collect Results
if: ${{ always() }}
run: ./gradlew collectResults
- uses: actions/upload-artifact@v4
if: ${{ always() }}
with:
name: test-output
path: build/test-output/
- name: Push result to Testspace server
if: ${{ github.ref == 'refs/heads/master' && always()}}
run: |
testspace $(find . -path *test-results* -name *.xml)
build-job-mac:
name: "Build Mac"
runs-on: macos-latest
needs: build-job
concurrency:
group: ${{ github.ref }}-mac
cancel-in-progress: true
env:
TAGGER_VERSION: ${{needs.build-job.outputs.version}}
GH_TOKEN: ${{ secrets.TESTMINTS_PAT }}
GITHUB_TOKEN: ${{ secrets.TESTMINTS_PAT }}
ORG_GRADLE_PROJECT_signingKey: ${{ secrets.SIGNING_KEY }}
ORG_GRADLE_PROJECT_signingPassword: ${{ secrets.SIGNING_PASSWORD }}
SONATYPE_USERNAME: ${{ secrets.SONATYPE_USERNAME }}
SONATYPE_PASSWORD: ${{ secrets.SONATYPE_PASSWORD }}
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: actions/setup-java@v4
with:
distribution: 'zulu'
java-version: '21'
- uses: testspace-com/setup-testspace@v1
if: ${{ github.ref == 'refs/heads/master' }}
with:
domain: robertfmurdock
- name: Setup Gradle
uses: gradle/actions/setup-gradle@v4
with:
cache-read-only: ${{ github.ref != 'refs/heads/master' }}
- name: Release π¨
run: |
./gradlew release \
-Pversion=${{ env.TAGGER_VERSION }} \
-Prelease-target=mac \
--scan \
--no-configuration-cache \
-x :plugins:publish \
-x :plugins:initializeSonatypeStagingRepository \
-x :plugins:closeSonatypeStagingRepository \
-x :plugins:action-mint-plugin:publishPlugins \
-x :plugins:mint-logs-plugin:publishPlugins
- name: Collect Test Results
if: ${{ always() }}
run: ./gradlew collectResults
- uses: actions/upload-artifact@v4
if: ${{ always() }}
with:
name: test-output
path: |
build/test-output/
- name: Push result to Testspace server
if: ${{ github.ref == 'refs/heads/master' && always()}}
run: |
testspace $(find . -path *test-results* -name *.xml)