Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
S
skiko
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
liuqiang
skiko
Commits
30b588f5
Unverified
Commit
30b588f5
authored
Nov 16, 2021
by
Alexey Tsvetkov
Committed by
GitHub
Nov 16, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix downloading artifacts for GH release (#389)
parent
a97f6e93
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
42 additions
and
48 deletions
+42
-48
build.gradle.kts
skiko/build.gradle.kts
+0
-9
build.gradle.kts
skiko/ci/build.gradle.kts
+41
-39
settings.gradle.kts
skiko/settings.gradle.kts
+1
-0
No files found.
skiko/build.gradle.kts
View file @
30b588f5
...
...
@@ -19,15 +19,6 @@ fun targetSuffix(os: OS, arch: Arch): String {
return
"${os.id}_${arch.id}"
}
buildscript
{
dependencies
{
classpath
(
"org.kohsuke:github-api:1.116"
)
}
repositories
{
mavenCentral
()
}
}
val
skiko
=
SkikoProperties
(
rootProject
)
val
buildType
=
skiko
.
buildType
val
generatedKotlin
=
"$buildDir/kotlin/commonMain"
...
...
skiko/ci/build.gradle.kts
View file @
30b588f5
...
...
@@ -2,15 +2,8 @@ import org.kohsuke.github.*
import
org.jetbrains.compose.internal.publishing.*
val
skiko
=
SkikoProperties
(
project
)
val
mavenCentral
=
MavenCentralProperties
(
project
)
val
GITHUB_REPO
=
"JetBrains/skiko"
fun
connectToGitHub
()
=
GitHubBuilder
()
.
withOAuthToken
(
System
.
getenv
(
"SKIKO_GH_RELEASE_TOKEN"
))
.
build
()
repositories
{
maven
(
skiko
.
composeRepoUrl
)
}
val
skikoArtifactIds
:
List
<
String
>
=
listOf
(
...
...
@@ -29,30 +22,40 @@ val skikoArtifactIds: List<String> =
SkikoArtifacts
.
nativeArtifactIdFor
(
OS
.
IOS
,
Arch
.
Arm64
),
)
val
githubArtifacts
by
configurations
.
creating
dependencies
{
for
(
artifactId
in
skikoArtifactIds
)
{
githubArtifacts
(
"org.jetbrains.skiko:$artifactId:${skiko.deployVersion}"
)
{
isTransitive
=
false
}
}
val
downloadSkikoArtifactsFromComposeDev
by
tasks
.
registering
(
DownloadFromSpaceMavenRepoTask
::
class
)
{
modulesToDownload
.
set
(
skikoMavenModules
(
skiko
.
deployVersion
))
spaceRepoUrl
.
set
(
"https://maven.pkg.jetbrains.space/public/p/compose/dev"
)
}
val
createGithubRelease
by
tasks
.
registering
{
dependsOn
(
downloadSkikoArtifactsFromComposeDev
)
doLast
{
check
(
skiko
.
isRelease
)
{
"This task should only be called for releases!"
}
val
gh
=
connectToGitHub
()
val
githubVersion
=
skiko
.
releaseGithubVersion
val
githubCommit
=
skiko
.
releaseGithubCommit
val
repo
=
gh
.
getRepository
(
"JetBrains/skiko"
)
val
repo
=
gh
.
getRepository
(
GITHUB_REPO
)
val
release
=
repo
.
createRelease
(
"v$githubVersion"
)
.
name
(
"Version $githubVersion"
)
.
commitish
(
githubCommit
)
.
create
()
githubArtifacts
.
filter
{
it
.
extension
==
"jar"
}
.
forEach
{
release
.
uploadAsset
(
it
,
"application/zip"
)
}
val
artifactsToUpload
=
skikoMavenModules
(
skiko
.
deployVersion
).
get
().
map
{
module
->
val
baseName
=
"${module.artifactId}-${module.version}"
val
pom
=
module
.
localDir
.
resolve
(
"$baseName.pom"
)
val
regex
=
"<packaging>([a-zA-Z0-9]+)</packaging>"
.
toRegex
()
val
ext
=
regex
.
find
(
pom
.
readText
())
?.
groupValues
?.
getOrNull
(
1
)
?:
"jar"
module
.
localDir
.
resolve
(
"$baseName.$ext"
).
also
{
check
(
it
.
exists
())
{
"'$it' does not exist"
}
}
}
for
(
artifact
in
artifactsToUpload
)
{
logger
.
info
(
"Uploading '$artifact'"
)
release
.
uploadAsset
(
artifact
,
"application/zip"
)
}
}
}
...
...
@@ -64,8 +67,21 @@ val deleteGithubRelease by tasks.registering {
}
}
fun
skikoMavenModules
(
version
:
Provider
<
String
>):
Provider
<
List
<
ModuleToUpload
>>
=
version
.
map
{
version
->
val
uploadSkikoArtifactsToMavenCentral
by
tasks
.
registering
(
UploadToSonatypeTask
::
class
)
{
dependsOn
(
downloadSkikoArtifactsFromComposeDev
)
version
.
set
(
skiko
.
deployVersion
)
modulesToUpload
.
set
(
skikoMavenModules
(
skiko
.
deployVersion
))
sonatypeServer
.
set
(
"https://oss.sonatype.org"
)
user
.
set
(
mavenCentral
.
user
)
password
.
set
(
mavenCentral
.
password
)
autoCommitOnSuccess
.
set
(
mavenCentral
.
autoCommitOnSuccess
)
stagingProfileName
.
set
(
"org.jetbrains.skiko"
)
}
fun
Project
.
skikoMavenModules
(
version
:
String
):
Provider
<
List
<
ModuleToUpload
>>
=
provider
{
val
artifactsDir
=
buildDir
.
resolve
(
"skiko-artifacts"
)
skikoArtifactIds
.
map
{
artifactId
->
...
...
@@ -79,21 +95,7 @@ fun skikoMavenModules(version: Provider<String>): Provider<List<ModuleToUpload>>
}
}
val
mavenCentral
=
MavenCentralProperties
(
project
)
val
downloadSkikoArtifactsFromComposeDev
by
tasks
.
registering
(
DownloadFromSpaceMavenRepoTask
::
class
)
{
modulesToDownload
.
set
(
skikoMavenModules
(
mavenCentral
.
version
))
spaceRepoUrl
.
set
(
"https://maven.pkg.jetbrains.space/public/p/compose/dev"
)
}
val
uploadSkikoArtifactsToMavenCentral
by
tasks
.
registering
(
UploadToSonatypeTask
::
class
)
{
dependsOn
(
downloadSkikoArtifactsFromComposeDev
)
version
.
set
(
mavenCentral
.
version
)
modulesToUpload
.
set
(
skikoMavenModules
(
mavenCentral
.
version
))
sonatypeServer
.
set
(
"https://oss.sonatype.org"
)
user
.
set
(
mavenCentral
.
user
)
password
.
set
(
mavenCentral
.
password
)
autoCommitOnSuccess
.
set
(
mavenCentral
.
autoCommitOnSuccess
)
stagingProfileName
.
set
(
"org.jetbrains.skiko"
)
}
fun
connectToGitHub
()
=
GitHubBuilder
()
.
withOAuthToken
(
System
.
getenv
(
"SKIKO_GH_RELEASE_TOKEN"
))
.
build
()
\ No newline at end of file
skiko/settings.gradle.kts
View file @
30b588f5
...
...
@@ -10,6 +10,7 @@ pluginManagement {
}
dependencies
{
classpath
(
"org.jetbrains.compose.internal.build-helpers:publishing:0.1.0"
)
classpath
(
"org.kohsuke:github-api:1.116"
)
}
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment