Skip to content

Commit 3453bf7

Browse files
committed
Fixes for github CI
- Set the sonatype credential environment - checkout in the release job, because hub requires running in the git repo - Improve the cache usage
1 parent f996299 commit 3453bf7

File tree

1 file changed

+13
-10
lines changed

1 file changed

+13
-10
lines changed

.github/workflows/ci.yml

Lines changed: 13 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -22,17 +22,20 @@ jobs:
2222
~/.ivy2/cache
2323
~/.sbt
2424
~/.coursier
25-
key: ${{ runner.os }}-sbt-${{ hashFiles('**/*.sbt') }}-${{ matrix.scala_version }}
25+
target/
26+
*/target/
27+
key: ${{ runner.os }}-sbt-${{ hashFiles('**/*.sbt') }}-${{ hashFiles('**/*.scala') }}
2628
restore-keys: |
2729
${{ runner.os }}-sbt-${{ hashFiles('**/*.sbt') }}-
30+
${{ runner.os }}-sbt-
2831
- name: Build
2932
run: sbt compile packageBin packageDoc packageSrc
3033
- name: Test
3134
run: sbt test
3235
- uses: actions/upload-artifact@v2
3336
with:
34-
name: target
35-
path: '*/target/'
37+
name: jars
38+
path: '*/target/*/*.jar'
3639
retention-days: 1
3740
publish:
3841
if: github.event_name != 'pull_request'
@@ -46,25 +49,25 @@ jobs:
4649
~/.ivy2/cache
4750
~/.sbt
4851
~/.coursier
49-
key: ${{ runner.os }}-sbt-${{ hashFiles('**/*.sbt') }}-${{ matrix.scala_version }}
50-
restore-keys: |
51-
${{ runner.os }}-sbt-${{ hashFiles('**/*.sbt') }}-
52-
- uses: actions/download-artifact@v2
53-
with:
54-
name: target
52+
target/
53+
*/target/
54+
key: ${{ runner.os }}-sbt-${{ hashFiles('**/*.sbt') }}-${{ hashFiles('**/*.scala') }}
5555
- name: Publish to Sonatype
5656
run: bash publish.sh
5757
env:
5858
PGP_SECRET: ${{ secrets.PGP_SECRET }}
59+
SONATYPE_USERNAME: ${{ secrets.SONATYPE_USERNAME }}
60+
SONATYPE_PASSWORD: ${{ secrets.SONATYPE_PASSWORD }}
5961
release:
6062
if: startsWith(github.ref, 'refs/tags')
6163
runs-on: ubuntu-latest
6264
needs: build-and-test
6365
steps:
66+
- uses: actions/checkout@v2
6467
- name: Download artifacts
6568
uses: actions/download-artifact@v2
6669
with:
67-
name: target
70+
name: jars
6871
- name: Upload assets
6972
env:
7073
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

0 commit comments

Comments
 (0)