-
-
Notifications
You must be signed in to change notification settings - Fork 124
135 lines (133 loc) · 5.22 KB
/
ci.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
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
name: ci
on: [ push, pull_request ]
jobs:
ci:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v3
- name: Set up JDK 11
uses: actions/setup-java@v3
with:
distribution: 'temurin'
java-version: '11'
- name: test
run: |
chmod 0600 $GITHUB_WORKSPACE/vendor/vendor-apple/base/src/test/resources/fixtures/derived-data-manager/test_rsa
./gradlew clean test jacocoTestReport integrationTest
bash <(curl -s https://codecov.io/bash)
- name: Publish Test Report
uses: mikepenz/action-junit-report@v3
if: always()
with:
report_paths: '**/build/test-results/test/TEST-*.xml'
- name: detekt
run: |
./gradlew clean detektCheck || true
- name: validateGradlePlugins
run: |
./gradlew validatePlugins
cd-snapshot:
runs-on: ubuntu-22.04
needs: ci
if: ${{ github.ref == 'refs/heads/develop' }}
steps:
- uses: actions/checkout@v3
- name: Set up JDK 11
uses: actions/setup-java@v3
with:
distribution: 'temurin'
java-version: '11'
- name: deliver maven
run: |
bash .buildsystem/deploy-sonatype.sh
env:
SONATYPE_USERNAME: ${{ secrets.SONATYPE_USERNAME }}
SONATYPE_PASSWORD: ${{ secrets.SONATYPE_PASSWORD }}
GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }}
BUGSNAG_TOKEN: ${{ secrets.BUGSNAG_TOKEN }}
- name: deliver cli
run: |
./gradlew :cli:publishDistZipPublicationToGitHubRepository -PreleaseMode=SNAPSHOT
env:
GH_MAVEN_USERNAME: ${{ secrets.GH_MAVEN_USERNAME }}
GH_MAVEN_PASSWORD: ${{ secrets.GITHUB_TOKEN }}
SONATYPE_USERNAME: ${{ secrets.SONATYPE_USERNAME }}
GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }}
BUGSNAG_TOKEN: ${{ secrets.BUGSNAG_TOKEN }}
cd-release:
runs-on: ubuntu-22.04
needs: ci
if: ${{ startsWith(github.ref, 'refs/tags/') }}
steps:
- uses: actions/checkout@v3
- name: Set up JDK 11
uses: actions/setup-java@v3
with:
distribution: 'temurin'
java-version: '11'
- uses: little-core-labs/get-git-tag@v3.0.2
id: tag
if: ${{ startsWith(github.ref, 'refs/tags/') }}
- name: deliver maven
run: |
bash .buildsystem/deploy-sonatype.sh
env:
SONATYPE_USERNAME: ${{ secrets.SONATYPE_USERNAME }}
SONATYPE_PASSWORD: ${{ secrets.SONATYPE_PASSWORD }}
GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }}
BUGSNAG_TOKEN: ${{ secrets.BUGSNAG_TOKEN }}
- name: assemble cli
run: |
./gradlew :cli:assembleDist -PreleaseMode=RELEASE
rm -f cli/build/distributions/marathon-*-SNAPSHOT.zip || true
env:
BUGSNAG_TOKEN: ${{ secrets.BUGSNAG_TOKEN }}
- name: deliver cli
uses: softprops/action-gh-release@v1
with:
files: cli/build/distributions/marathon-*.zip
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: deliver gradle plugin
run: ./gradlew :marathon-gradle-plugin:publishPlugins -Pgradle.publish.key=$GRADLE_PUBLISH_KEY -Pgradle.publish.secret=$GRADLE_PUBLISH_SECRET -PreleaseMode=RELEASE
env:
GRADLE_PUBLISH_KEY: ${{ secrets.GRADLE_PUBLISH_KEY }}
GRADLE_PUBLISH_SECRET: ${{ secrets.GRADLE_PUBLISH_SECRET }}
- uses: actions/checkout@v4
with:
repository: 'Malinskiy/homebrew-tap'
ref: 'master'
path: 'homebrew-tap'
token: ${{ secrets.HOMEBREW_TAP_GITHUB_TOKEN }}
- uses: ruby/setup-ruby@v1
with:
ruby-version: 3.3
- name: deliver homebrew formulae
run: |
gem install liquid-cli
URL="https://github.com/MarathonLabs/marathon/releases/download/${{ steps.tag.outputs.tag }}/marathon-${{ steps.tag.outputs.tag }}.zip"
SHA256=$(curl -L --retry 5 --retry-max-time 120 $URL | sha256sum | sed 's/ -//')
echo "{\"version\":\"${{ steps.tag.outputs.tag }}\",\"sha256\":\"$SHA256\"}" > .github/marathon.json
cat .github/marathon.json | jq .
cat .github/marathon.rb.liquid | liquid "$(< .github/marathon.json)" > homebrew-tap/Formula/marathon.rb
cd homebrew-tap
git config --global user.name 'Anton Malinskiy'
git config --global user.email 'malinskiy@users.noreply.github.com'
git commit -am "Brew formula update for marathon version ${{ steps.tag.outputs.tag }}"
git push
notify:
needs: cd-release
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v3
- uses: little-core-labs/get-git-tag@v3.0.2
if: ${{ startsWith(github.ref, 'refs/tags/') }}
- name: Set output
run: echo "version=$GIT_TAG_NAME" >> $GITHUB_OUTPUT
- name: Send Telegram Release message
uses: appleboy/telegram-action@master
with:
to: ${{ secrets.TELEGRAM_TO }}
token: ${{ secrets.TELEGRAM_TOKEN }}
message: |
New Marathon version ${{ steps.notify.outputs.version }} has been submitted to Maven central and will be available soon https://github.com/MarathonLabs/marathon/releases/