-
Notifications
You must be signed in to change notification settings - Fork 7
97 lines (89 loc) · 3.24 KB
/
Copy pathpublish.yml
File metadata and controls
97 lines (89 loc) · 3.24 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
name: Publish
on:
workflow_call:
inputs:
ref:
type: string
required: false
default: ''
java:
type: string
required: false
default: 17
java-index:
type: string
required: false
default: ''
ignore-job-coursier-cache:
type: boolean
required: false
default: true
extra-coursier-cache-key:
type: string
required: false
default: ''
cmd:
type: string
required: false
default: "sbt ci-release"
gradle-build-root:
type: string
required: false
default: ""
jobs:
cmd:
name: JDK ${{ inputs.java }}
runs-on: ubuntu-24.04
if: ${{ github.event.repository.fork == false }}
steps:
- name: Block deprecated repos in /etc/hosts
run: |
sudo echo "127.0.0.1 repo.scala-sbt.org" | sudo tee -a /etc/hosts
sudo echo "127.0.0.1 repo.typesafe.com" | sudo tee -a /etc/hosts
- name: Checkout
uses: actions/checkout@v7
with:
# we don't know what commit the last tag was it's safer to get entire repo so previousStableVersion resolves
fetch-depth: 0
ref: ${{ inputs.ref }}
- name: Coursier Cache
id: coursier-cache
uses: coursier/cache-action@v8
with:
ignoreJob: ${{ inputs.ignore-job-coursier-cache }}
ignoreMatrix: true
extraKey: ${{ inputs.extra-coursier-cache-key }}
- name: Gradle Cache
uses: burrunan/gradle-cache-action@v3
with:
build-root-directory: ${{ inputs.gradle-build-root }}
# Disable caching of ~/.gradle/caches/build-cache-*
save-local-build-cache: false
# Disable caching of ~/.m2/repository/
save-maven-dependencies-cache: false
- name: Install Adoptium Temurin OpenJDK
uses: coursier/setup-action@v3
with:
jvm: adoptium:${{ inputs.java }}
jvm-index: ${{ inputs.java-index }}
- name: Install sbt
uses: sbt/setup-sbt@v1
- name: Publish artifacts
run: ${{ inputs.cmd }}
env:
# Credentials for publishing to Sonatype https://github.com/sbt/sbt-ci-release#secrets
SONATYPE_USERNAME: ${{ secrets.SONATYPE_USERNAME }}
SONATYPE_PASSWORD: ${{ secrets.SONATYPE_PASSWORD }}
# Keys for signing https://github.com/sbt/sbt-ci-release#secrets
PGP_PASSPHRASE: ${{ secrets.PGP_PASSPHRASE }}
PGP_SECRET: ${{ secrets.PGP_SECRET }}
# Gradle Plugin Portal API Keys https://docs.gradle.org/current/userguide/publishing_gradle_plugins.html
GRADLE_PUBLISH_KEY: ${{ secrets.GRADLE_PUBLISH_KEY }}
GRADLE_PUBLISH_SECRET: ${{ secrets.GRADLE_PUBLISH_SECRET }}
- name: Cleanup before cache
shell: bash
run: |
find $HOME/Library/Caches/Coursier/v1 -name "ivydata-*.properties" -delete || true
find $HOME/.ivy2/cache -name "ivydata-*.properties" -delete || true
find $HOME/.cache/coursier/v1 -name "ivydata-*.properties" -delete || true
find $HOME/.sbt -name "*.lock" -delete || true