Skip to content

Commit 6d5288a

Browse files
committed
clean up github actions, more deployment into build.gradle
1 parent 479c795 commit 6d5288a

File tree

7 files changed

+102
-157
lines changed

7 files changed

+102
-157
lines changed

.github/workflows/gradle-publish.yml

Lines changed: 0 additions & 35 deletions
This file was deleted.

.github/workflows/javadoc.yml

Lines changed: 0 additions & 38 deletions
This file was deleted.

.github/workflows/nightlydeploy.yml

Lines changed: 66 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Nightly Deployer of Weekly Builds
1+
name: Weekly Builds of KeY
22

33
on:
44
workflow_dispatch:
@@ -9,9 +9,12 @@ permissions:
99
contents: write
1010
id-token: write
1111

12+
env:
13+
JAVA_VERSION: 21
14+
1215

1316
jobs:
14-
deploy:
17+
build:
1518
runs-on: ubuntu-latest
1619
steps:
1720
# weigl: Should produce fancier release notes, but needs some configuration
@@ -27,14 +30,52 @@ jobs:
2730
- name: Set up JDK 21
2831
uses: actions/setup-java@v5
2932
with:
30-
java-version: 21
33+
java-version: ${{ env.JAVA_VERSION }}
3134
distribution: 'temurin'
35+
cache: 'gradle'
3236

3337
- name: Setup Gradle
3438
uses: gradle/actions/setup-gradle@v5
3539
- name: Build with Gradle
3640
run: ./gradlew --parallel assemble
3741

42+
doc:
43+
needs: [build]
44+
runs-on: ubuntu-latest
45+
steps:
46+
- uses: actions/checkout@v4
47+
- name: Set up JDK 21
48+
uses: actions/setup-java@v4
49+
with:
50+
java-version: ${{ env.JAVA_VERSION }}
51+
distribution: 'corretto'
52+
cache: 'gradle'
53+
54+
- name: Setup Gradle
55+
uses: gradle/actions/setup-gradle@v4
56+
57+
- name: Build Documentation with Gradle
58+
run: ./gradlew alldoc
59+
60+
- name: Package
61+
run: tar cvf key-javadoc.tar.xz build/docs/javadoc
62+
63+
deploy:
64+
needs: [build, doc]
65+
runs-on: ubuntu-latest
66+
steps:
67+
- name: Upload Javadoc
68+
uses: actions/upload-artifact@v4
69+
with:
70+
name: javadoc
71+
path: "javadoc.tar.xz"
72+
73+
- name: Upload ShadowJar
74+
uses: actions/upload-artifact@v4
75+
with:
76+
name: shadowjars
77+
path: "*/build/libs/*-exe.jar"
78+
3879
- name: Delete previous nightly release
3980
continue-on-error: true
4081
env:
@@ -50,3 +91,25 @@ jobs:
5091
gh release create --generate-notes --title "Nightly Release" \
5192
--prerelease --notes-start-tag KEY-2.12.3 \
5293
nightly key.ui/build/libs/key-*-exe.jar
94+
95+
deploy-maven:
96+
needs: [ build, doc ]
97+
runs-on: ubuntu-latest
98+
steps:
99+
- uses: actions/checkout@v4
100+
- name: Set up JDK 21
101+
uses: actions/setup-java@v4
102+
with:
103+
java-version: ${{ env.JAVA_VERSION }}
104+
distribution: 'temurin'
105+
cache: 'gradle'
106+
107+
- name: Setup Gradle
108+
uses: gradle/actions/setup-gradle@v4
109+
110+
- name: Upload to SNAPSHOT repository
111+
run: ./gradlew publishToCentral
112+
env:
113+
BUILD_NUMBER: "SNAPSHOT"
114+
ossrhUsername: ${{ secrets.MAVEN_CENTRAL_USER }}
115+
ossrhPassword: ${{ secrets.MAVEN_CENTRAL_PASSWORD }}

.github/workflows/sonarqube.yml

Lines changed: 0 additions & 49 deletions
This file was deleted.

build.gradle

Lines changed: 32 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,6 @@ subprojects {
111111
}
112112

113113
tasks.withType(Test).configureEach {//Configure all tests
114-
115114
def examplesDir = rootProject.layout.projectDirectory.dir("key.ui/examples").getAsFile()
116115
def runAllProofsReportDir = layout.buildDirectory.dir("report/runallproves/").get().getAsFile()
117116
systemProperty "test-resources", "src/test/resources"
@@ -325,9 +324,29 @@ subprojects {
325324
}
326325
repositories {
327326
maven {
328-
name = "keylocal"
327+
name = "LOCAL"
329328
url= uri("$rootDir/local")
330329
}
330+
331+
maven { // deployment to git.key-project.org/key-public/key
332+
name = "KEYLAB"
333+
url = uri("https://git.key-project.org/api/v4/projects/35/packages/maven")
334+
credentials(HttpHeaderCredentials) {
335+
// Gitlab supports three kinds of token.
336+
if (System.getenv("TOKEN") != null) {
337+
// Support for user token
338+
name = 'Private-Token'
339+
value = envOrPropertyValue("TOKEN")
340+
} else {
341+
// Support for Gitlab CI
342+
name = 'Job-Token'
343+
value = envOrPropertyValue("CI_JOB_TOKEN")
344+
}
345+
}
346+
authentication {
347+
header(HttpHeaderAuthentication)
348+
}
349+
}
331350
}
332351
}
333352

@@ -364,34 +383,8 @@ nexusPublishing {
364383
* You can test signing with `gradle sign`, and publish with `gradle publish`.
365384
* https://central.sonatype.org/publish/publish-guide/
366385
*/
367-
username = project.properties.getOrDefault("ossrhUsername", "")
368-
password = project.properties.getOrDefault("ossrhPassword", "")
369-
}
370-
}
371-
}
372-
373-
maven { // deployment to git.key-project.org
374-
name = "GitlabPackages"
375-
url "https://git.key-project.org/api/v4/projects/35/packages/maven"
376-
credentials(HttpHeaderCredentials) {
377-
if (System.getenv("TOKEN") != null) {
378-
name = 'Private-Token'
379-
value = System.getenv("TOKEN")
380-
} else {
381-
name = 'Job-Token'
382-
value = System.getenv("CI_JOB_TOKEN")
383-
}
384-
}
385-
authentication {
386-
header(HttpHeaderAuthentication)
387-
}
388-
}
389-
}
390-
}
391-
392-
signing {
393-
useGpgCmd() // works better than the Java implementation, which requires PGP keyrings.
394-
sign publishing.publications.mavenJava
386+
username = envOrPropertyValue("ossrhUsername")
387+
password = envOrPropertyValue("ossrhPassword")
395388
}
396389
}
397390
}
@@ -447,3 +440,12 @@ if (jacocoEnabled.toBoolean()) {
447440
project.logger.lifecycle("Jacoco enabled. Test performance will be slower.")
448441
apply from: rootProject.file("scripts/jacocokey.gradle")
449442
}
443+
444+
445+
def envOrPropertyValue(String key) {
446+
if(key in System.getenv()) {
447+
return System.getenv(key)
448+
}else{
449+
return project.properties.getOrDefault(key, "$key-not-found")
450+
}
451+
}

key.core.example/src/main/java/org/key_project/Main.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,8 @@ public static void main(String[] args) {
5757
*
5858
* @param location the Path with the path to the source directory of the Java project
5959
* to be verified
60-
* @return the {@link KeYEnvironment} that provides the context for all following verification tasks
60+
* @return the {@link KeYEnvironment} that provides the context for all following verification
61+
* tasks
6162
* @throws ProblemLoaderException if the setup fails
6263
*/
6364
private static KeYEnvironment<?> setupEnvironment(Path location) throws ProblemLoaderException {

key.core/src/main/java/de/uka/ilkd/key/java/Services.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -453,7 +453,8 @@ public void setFactory(ITermProgramVariableCollectorFactory factory) {
453453
/**
454454
* sets the factory for origin term labels
455455
*
456-
* @param originFactory the {@link OriginTermLabelFactory} to use, if null is passed, origin labels
456+
* @param originFactory the {@link OriginTermLabelFactory} to use, if null is passed, origin
457+
* labels
457458
* should not be created
458459
*/
459460
public void setOriginFactory(OriginTermLabelFactory originFactory) {

0 commit comments

Comments
 (0)