mirror of
https://github.com/GayPizzaSpecifications/drywall.git
synced 2025-08-02 17:10:54 +00:00
maven publishing workflow
This commit is contained in:
parent
aa05cba89f
commit
0e0d0158ae
17
.github/workflows/plugin.yml
vendored
Normal file
17
.github/workflows/plugin.yml
vendored
Normal file
@ -0,0 +1,17 @@
|
||||
name: Plugin
|
||||
on: [push]
|
||||
jobs:
|
||||
build:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout Repository
|
||||
uses: actions/checkout@v3
|
||||
- name: Set up JDK 17
|
||||
uses: actions/setup-java@v3
|
||||
with:
|
||||
java-version: '17'
|
||||
distribution: 'temurin'
|
||||
- name: Build with Gradle
|
||||
uses: gradle/gradle-build-action@v2
|
||||
with:
|
||||
arguments: build
|
23
.github/workflows/publish.yml
vendored
Normal file
23
.github/workflows/publish.yml
vendored
Normal file
@ -0,0 +1,23 @@
|
||||
name: Publish
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- master
|
||||
jobs:
|
||||
publish:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout Repository
|
||||
uses: actions/checkout@v3
|
||||
- name: Set up JDK 17
|
||||
uses: actions/setup-java@v3
|
||||
with:
|
||||
java-version: '17'
|
||||
distribution: 'temurin'
|
||||
- name: Publish with Gradle
|
||||
uses: gradle/gradle-build-action@v2
|
||||
with:
|
||||
arguments: publishAllPublicationsToGitHubPackagesRepository publishAllPublicationsToGitLabRepository
|
||||
env:
|
||||
GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
|
||||
GITLAB_TOKEN: "${{ secrets.GITLAB_TOKEN }}"
|
@ -1,6 +1,7 @@
|
||||
plugins {
|
||||
`kotlin-dsl`
|
||||
kotlin("plugin.serialization") version "1.5.31"
|
||||
`maven-publish`
|
||||
}
|
||||
|
||||
group = "gay.pizza.foundation"
|
||||
@ -37,3 +38,41 @@ gradlePlugin {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
publishing {
|
||||
repositories {
|
||||
mavenLocal()
|
||||
|
||||
var githubPackagesToken = System.getenv("GITHUB_TOKEN")
|
||||
if (githubPackagesToken == null) {
|
||||
githubPackagesToken = project.findProperty("github.token") as String?
|
||||
}
|
||||
|
||||
var gitlabPackagesToken = System.getenv("GITLAB_TOKEN")
|
||||
if (gitlabPackagesToken == null) {
|
||||
gitlabPackagesToken = project.findProperty("gitlab.com.accessToken") as String?
|
||||
}
|
||||
|
||||
maven {
|
||||
name = "GitHubPackages"
|
||||
url = uri("https://maven.pkg.github.com/gaypizzaspecifications/drywall")
|
||||
credentials {
|
||||
username = project.findProperty("github.username") as String? ?: "gaypizzaspecifications"
|
||||
password = githubPackagesToken
|
||||
}
|
||||
}
|
||||
|
||||
maven {
|
||||
name = "GitLab"
|
||||
url = uri("https://gitlab.com/api/v4/projects/47347654/packages/maven")
|
||||
credentials(HttpHeaderCredentials::class.java) {
|
||||
name = "Private-Token"
|
||||
value = gitlabPackagesToken
|
||||
}
|
||||
|
||||
authentication {
|
||||
create<HttpHeaderAuthentication>("header")
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user