mirror of
https://codeberg.org/moonleay/Gimbal.git
synced 2025-06-06 08:26:16 +02:00
ci: added ci
Signed-off-by: moonleay <contact@moonleay.net>
This commit is contained in:
parent
68e9eeceb6
commit
e80e798482
2 changed files with 30 additions and 7 deletions
22
.forgejo/workflows/build-dev.yml
Normal file
22
.forgejo/workflows/build-dev.yml
Normal file
|
@ -0,0 +1,22 @@
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
release:
|
||||||
|
runs-on: selfhosted
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v3
|
||||||
|
name: Checkout
|
||||||
|
- uses: https://github.com/actions/setup-java@v4
|
||||||
|
name: Setup Java
|
||||||
|
with:
|
||||||
|
distribution: temurin
|
||||||
|
java-version: 17
|
||||||
|
- uses: https://github.com/gradle/actions/setup-gradle@v3
|
||||||
|
name: Setup Gradle
|
||||||
|
- run: ./gradlew runDatagen
|
||||||
|
name: Generate assets
|
||||||
|
- run: ./gradlew build
|
||||||
|
name: Build Project
|
||||||
|
- run: ./gradlew publish
|
||||||
|
name: Upload
|
|
@ -184,17 +184,18 @@ publishing {
|
||||||
}
|
}
|
||||||
|
|
||||||
repositories {
|
repositories {
|
||||||
if (System.getenv("CI_JOB_TOKEN") != null) {
|
if (System.getenv("CI") != null) {
|
||||||
maven {
|
maven {
|
||||||
name = "GitLab"
|
name = "Codeberg"
|
||||||
val projectId = System.getenv("CI_PROJECT_ID")
|
val repoOwner = System.getenv("GITHUB_REPOSITORY_OWNER")
|
||||||
val apiV4 = System.getenv("CI_API_V4_URL")
|
val apiEndpoint = System.getenv("GITHUB_API_URL")
|
||||||
url = uri("$apiV4/projects/$projectId/packages/maven")
|
url = uri("$apiEndpoint/packages/$repoOwner/maven")
|
||||||
authentication {
|
authentication {
|
||||||
create("token", HttpHeaderAuthentication::class.java) {
|
create("token", HttpHeaderAuthentication::class.java) {
|
||||||
|
val accessToken = System.getenv("GITHUB_TOKEN")
|
||||||
credentials(HttpHeaderCredentials::class.java) {
|
credentials(HttpHeaderCredentials::class.java) {
|
||||||
name = "Job-Token"
|
name = "Authorization"
|
||||||
value = System.getenv("CI_JOB_TOKEN")
|
value = "token $accessToken"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue