Skip to content

Commit 97fb2aa

Browse files
committed
Update publish workflow
1 parent d693d08 commit 97fb2aa

File tree

1 file changed

+50
-46
lines changed

1 file changed

+50
-46
lines changed

.github/workflows/publish.yml

Lines changed: 50 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,14 @@ jobs:
1212
build:
1313
strategy:
1414
matrix:
15-
os: [macOS-latest, windows-latest, ubuntu-latest]
16-
15+
os:
16+
- macOS-latest
17+
- windows-latest
18+
- ubuntu-latest
1719
runs-on: ${{matrix.os}}
18-
1920
steps:
20-
- name: Checkout the repo
21-
uses: actions/checkout@v2
21+
- name: Checkout the repo
22+
uses: actions/checkout@v2
2223

2324
- name: Cache gradle
2425
uses: actions/cache@v1
@@ -28,41 +29,41 @@ jobs:
2829
restore-keys: |
2930
${{ runner.os }}-gradle-
3031
31-
- name: Run ubuntu tests
32-
if: matrix.os == 'ubuntu-latest'
33-
run: ./gradlew check
32+
- name: Run ubuntu tests
33+
if: matrix.os == 'ubuntu-latest'
34+
run: ./gradlew check
3435

35-
- name: Run windows tests
36-
if: matrix.os == 'windows-latest'
37-
run: ./gradlew mingwX64Test
36+
- name: Run windows tests
37+
if: matrix.os == 'windows-latest'
38+
run: ./gradlew mingwX64Test
3839

39-
- name: Run macOS tests
40-
if: matrix.os == 'macOS-latest'
41-
run: ./gradlew macosX64Test
40+
- name: Run macOS tests
41+
if: matrix.os == 'macOS-latest'
42+
run: ./gradlew macosX64Test
4243

43-
- name: Bundle the build report
44-
if: failure()
45-
run: find . -type d -name 'reports' | zip -@ -r build-reports.zip
44+
- name: Bundle the build report
45+
if: failure()
46+
run: find . -type d -name 'reports' | zip -@ -r build-reports.zip
4647

47-
- name: Upload the build report
48-
if: failure()
49-
uses: actions/upload-artifact@master
50-
with:
51-
name: error-report
52-
path: build-reports.zip
48+
- name: Upload the build report
49+
if: failure()
50+
uses: actions/upload-artifact@master
51+
with:
52+
name: error-report
53+
path: build-reports.zip
5354

5455
deploy-mac-and-linux:
5556
needs: build
5657
runs-on: macOS-latest
5758
steps:
58-
- name: Checkout the repo
59-
uses: actions/checkout@v2
59+
- name: Checkout the repo
60+
uses: actions/checkout@v2
6061
# checkout the full repo so we can count commits for a build number
61-
with:
62-
fetch-depth: 0
62+
with:
63+
fetch-depth: 0
6364

64-
- name: Fetch git tags
65-
run: git fetch origin +refs/tags/*:refs/tags/*
65+
- name: Fetch git tags
66+
run: git fetch origin +refs/tags/*:refs/tags/*
6667

6768
- name: Cache gradle
6869
uses: actions/cache@v1
@@ -72,28 +73,31 @@ jobs:
7273
restore-keys: |
7374
${{ runner.os }}-gradle-
7475
75-
- name: Deploy to sonatype snapshots
76-
run: ./gradlew publish -PinferVersion=true
77-
env:
78-
ORG_GRADLE_PROJECT_SONATYPE_USERNAME: ${{ secrets.ORG_GRADLE_PROJECT_SONATYPE_USERNAME }}
79-
ORG_GRADLE_PROJECT_SONATYPE_PASSWORD: ${{ secrets.ORG_GRADLE_PROJECT_SONATYPE_PASSWORD }}
80-
ORG_GRADLE_PROJECT_signingKey: ${{ secrets.ORG_GRADLE_PROJECT_signingKey }}
76+
- name: Deploy to sonatype snapshots
77+
run: ./gradlew :clikt:publish -PinferVersion=true
78+
env:
79+
ORG_GRADLE_PROJECT_SONATYPE_USERNAME: ${{ secrets.ORG_GRADLE_PROJECT_SONATYPE_USERNAME }}
80+
ORG_GRADLE_PROJECT_SONATYPE_PASSWORD: ${{ secrets.ORG_GRADLE_PROJECT_SONATYPE_PASSWORD }}
81+
ORG_GRADLE_PROJECT_signingKey: ${{ secrets.ORG_GRADLE_PROJECT_signingKey }}
8182

8283
deploy-windows:
8384
needs: build
8485
runs-on: windows-latest
8586
steps:
86-
- name: Checkout the repo
87-
uses: actions/checkout@v2
88-
with:
89-
fetch-depth: 0
90-
- run: git fetch origin +refs/tags/*:refs/tags/*
91-
- name: Deploy to sonatype snapshots
92-
run: ./gradlew publishMingwX64PublicationToMavenRepository -PinferVersion=true
93-
env:
94-
ORG_GRADLE_PROJECT_SONATYPE_USERNAME: ${{ secrets.ORG_GRADLE_PROJECT_SONATYPE_USERNAME }}
95-
ORG_GRADLE_PROJECT_SONATYPE_PASSWORD: ${{ secrets.ORG_GRADLE_PROJECT_SONATYPE_PASSWORD }}
96-
ORG_GRADLE_PROJECT_signingKey: ${{ secrets.ORG_GRADLE_PROJECT_signingKey }}
87+
- name: Checkout the repo
88+
uses: actions/checkout@v2
89+
with:
90+
fetch-depth: 0
91+
92+
- name: Fetch git tags
93+
run: git fetch origin +refs/tags/*:refs/tags/*
94+
95+
- name: Deploy to sonatype snapshots
96+
run: ./gradlew publishMingwX64PublicationToMavenRepository -PinferVersion=true
97+
env:
98+
ORG_GRADLE_PROJECT_SONATYPE_USERNAME: ${{ secrets.ORG_GRADLE_PROJECT_SONATYPE_USERNAME }}
99+
ORG_GRADLE_PROJECT_SONATYPE_PASSWORD: ${{ secrets.ORG_GRADLE_PROJECT_SONATYPE_PASSWORD }}
100+
ORG_GRADLE_PROJECT_signingKey: ${{ secrets.ORG_GRADLE_PROJECT_signingKey }}
97101

98102
env:
99103
GRADLE_OPTS: -Dorg.gradle.configureondemand=true -Dorg.gradle.parallel=true -Dkotlin.incremental=false -Dorg.gradle.jvmargs="-Xmx3g -XX:MaxPermSize=2048m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8"

0 commit comments

Comments
 (0)