mirror of
https://codeberg.org/moonleay/Gimbal.git
synced 2025-04-04 19:54:13 +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 {
|
||||
if (System.getenv("CI_JOB_TOKEN") != null) {
|
||||
if (System.getenv("CI") != null) {
|
||||
maven {
|
||||
name = "GitLab"
|
||||
val projectId = System.getenv("CI_PROJECT_ID")
|
||||
val apiV4 = System.getenv("CI_API_V4_URL")
|
||||
url = uri("$apiV4/projects/$projectId/packages/maven")
|
||||
name = "Codeberg"
|
||||
val repoOwner = System.getenv("GITHUB_REPOSITORY_OWNER")
|
||||
val apiEndpoint = System.getenv("GITHUB_API_URL")
|
||||
url = uri("$apiEndpoint/packages/$repoOwner/maven")
|
||||
authentication {
|
||||
create("token", HttpHeaderAuthentication::class.java) {
|
||||
val accessToken = System.getenv("GITHUB_TOKEN")
|
||||
credentials(HttpHeaderCredentials::class.java) {
|
||||
name = "Job-Token"
|
||||
value = System.getenv("CI_JOB_TOKEN")
|
||||
name = "Authorization"
|
||||
value = "token $accessToken"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue