-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Move build files and remove submodule (#127)
* Move build plugins from pubnub-kotlin, remove submodule * Add NPM publishing configs * Change runner to macos, automate Swift package publishing * Add `kotlin` and `js` products for releasing
- Loading branch information
1 parent
3052402
commit 66bfe86
Showing
78 changed files
with
15,956 additions
and
2,437 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,73 @@ | ||
name: JS automated product release | ||
|
||
on: | ||
pull_request: | ||
branches: [master] | ||
types: [closed] | ||
paths: | ||
- 'js-chat/.pubnub.yml' | ||
|
||
jobs: | ||
check-release: | ||
name: Check release required | ||
if: github.event.pull_request.merged && endsWith(github.repository, '-private') != true | ||
runs-on: | ||
group: macos-gh | ||
outputs: | ||
release: ${{ steps.check.outputs.ready }} | ||
steps: | ||
- name: Checkout actions | ||
uses: actions/checkout@v4 | ||
with: | ||
repository: pubnub/client-engineering-deployment-tools | ||
ref: v1 | ||
token: ${{ secrets.GH_TOKEN }} | ||
path: .github/.release/actions | ||
- id: check | ||
name: Check pre-release completed | ||
uses: ./.github/.release/actions/actions/checks/release | ||
with: | ||
token: ${{ secrets.GH_TOKEN }} | ||
publish: | ||
name: Publish package | ||
needs: check-release | ||
if: needs.check-release.outputs.release == 'true' | ||
runs-on: | ||
group: macos-gh | ||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v4 | ||
with: | ||
# This should be the same as the one specified for on.pull_request.branches | ||
ref: master | ||
submodules: recursive | ||
- name: Checkout actions | ||
uses: actions/checkout@v4 | ||
with: | ||
repository: pubnub/client-engineering-deployment-tools | ||
ref: v1 | ||
token: ${{ secrets.GH_TOKEN }} | ||
path: .github/.release/actions | ||
- name: Publish to NPM | ||
uses: ./.github/.release/actions/actions/services/npm | ||
with: | ||
token: ${{ secrets.GH_TOKEN }} | ||
npm-token: ${{ secrets.NPM_TOKEN }} | ||
check-ownership: false | ||
package-path: package.json | ||
actions: "build,publish" | ||
build-command: npm run build | ||
build-path: dist | ||
last-service: true | ||
# - name: Update Pages | ||
# uses: ./.github/.release/actions/actions/services/github-pages | ||
# with: | ||
# token: ${{ secrets.GH_TOKEN }} | ||
# source-folder: build/dokka/gfmMultiModule | ||
# jira-api-key: ${{ secrets.JIRA_API_KEY }} | ||
# last-service: true | ||
# - name: Upload test reports | ||
# uses: ./.github/.release/actions/actions/test-reports/upload | ||
# with: | ||
# token: ${{ secrets.GH_TOKEN }} | ||
# acceptance-tests-workflow: Tests |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
echo "Build JS Chat SDK module artifacts" | ||
pushd .. | ||
./gradlew :jsNodeProductionLibraryDistribution | ||
./gradlew :packJsPackage | ||
mkdir -p js-chat/dist | ||
cp build/packages/js/package.json js-chat/package.json | ||
cp build/packages/js/index.d.ts js-chat/dist/ | ||
cp build/packages/js/index.d.ts js-chat/dist/index.es.d.ts | ||
popd | ||
npm run build |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
set -e | ||
echo "Build Kotlin and Swift Chat SDK module artifacts" | ||
./gradlew -PENABLE_TARGET_IOS_ALL=true :podPublishReleaseXCFramework assemble | ||
find build/cocoapods/publish/release/PubNubChat.xcframework -exec touch -t 00000000 {} + | ||
rm -f build/cocoapods/publish/release/PubNubChat.xcframework.zip | ||
zip -X -vr build/cocoapods/publish/release/PubNubChat.xcframework.zip build/cocoapods/publish/release/PubNubChat.xcframework | ||
touch -t 00000000 build/cocoapods/publish/release/PubNubChat.xcframework.zip | ||
CHECKSUM=$(swift package compute-checksum /Users/wojciech.kalicinski/projects/pubnub-chat/build/cocoapods/publish/release/PubNubChat.xcframework.zip) | ||
echo $CHECKSUM | ||
mkdir build/gh_artifacts | ||
mv build/cocoapods/publish/release/PubNubChat.xcframework.zip build/gh_artifacts/ |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
set -e | ||
echo "Update Swift Chat SDK checksum in Package.swift" | ||
./gradlew -PENABLE_TARGET_IOS_ALL=true :podPublishReleaseXCFramework | ||
find build/cocoapods/publish/release/PubNubChat.xcframework -exec touch -t 00000000 {} + | ||
rm -f build/cocoapods/publish/release/PubNubChat.xcframework.zip | ||
zip -X -vr build/cocoapods/publish/release/PubNubChat.xcframework.zip build/cocoapods/publish/release/PubNubChat.xcframework | ||
touch -t 00000000 build/cocoapods/publish/release/PubNubChat.xcframework.zip | ||
CHECKSUM=$(swift package compute-checksum /Users/wojciech.kalicinski/projects/pubnub-chat/build/cocoapods/publish/release/PubNubChat.xcframework.zip) | ||
echo $CHECKSUM | ||
sed -i.bak "s/checksum: \"[a-z0-9]*\"/checksum: \"$CHECKSUM\"/g" Package.swift | ||
rm Package.swift.bak |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,14 @@ | ||
{ | ||
"chat": { | ||
"kotlin": { | ||
"path": "./", | ||
"name": "PubNub Kotlin Chat SDK", | ||
"main": true, | ||
"overrideRelease": true | ||
}, | ||
"js": { | ||
"path": "./js-chat", | ||
"name": "PubNub JS Chat SDK", | ||
"main": true, | ||
"overrideRelease": true | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +0,0 @@ | ||
[submodule "pubnub-kotlin"] | ||
path = pubnub-kotlin | ||
url = https://github.com/pubnub/kotlin.git | ||
branch = master | ||
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
plugins { | ||
`java-gradle-plugin` | ||
alias(libs.plugins.kotlin.jvm) | ||
} | ||
|
||
dependencies { | ||
compileOnly(gradleKotlinDsl()) | ||
compileOnly(libs.nexus.gradlePlugin) | ||
compileOnly(libs.vanniktech.gradlePlugin) | ||
compileOnly(libs.kotlin.gradlePlugin) | ||
compileOnly(libs.ktlint.gradlePlugin) | ||
compileOnly(libs.dokka.gradlePlugin) | ||
} | ||
|
||
gradlePlugin { | ||
plugins { | ||
register("pubnubShared") { | ||
id = "pubnub.shared" | ||
implementationClass = "com.pubnub.gradle.PubNubSharedPlugin" | ||
} | ||
register("pubnubDokka") { | ||
id = "pubnub.dokka" | ||
implementationClass = "com.pubnub.gradle.PubNubDokkaPlugin" | ||
} | ||
register("pubnubKotlinLibrary") { | ||
id = "pubnub.kotlin-library" | ||
implementationClass = "com.pubnub.gradle.PubNubKotlinLibraryPlugin" | ||
} | ||
register("pubnubIosSimulatorTest") { | ||
id = "pubnub.ios-simulator-test" | ||
implementationClass = "com.pubnub.gradle.PubNubIosSimulatorTestPlugin" | ||
} | ||
register("pubnubMultiplatform") { | ||
id = "pubnub.multiplatform" | ||
implementationClass = "com.pubnub.gradle.PubNubKotlinMultiplatformPlugin" | ||
} | ||
register("pubnubBaseMultiplatform") { | ||
id = "pubnub.base.multiplatform" | ||
implementationClass = "com.pubnub.gradle.PubNubBaseKotlinMultiplatformPlugin" | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
org.gradle.parallel=false | ||
org.gradle.caching=true | ||
org.gradle.configuration-cache=true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
pluginManagement { | ||
repositories { | ||
gradlePluginPortal() | ||
mavenCentral() | ||
} | ||
} | ||
dependencyResolutionManagement { | ||
repositories { | ||
mavenCentral() | ||
gradlePluginPortal() | ||
} | ||
versionCatalogs { | ||
create("libs") { | ||
from(files("../../gradle/libs.versions.toml")) | ||
} | ||
} | ||
} | ||
|
||
rootProject.name = "gradle-plugins" |
38 changes: 38 additions & 0 deletions
38
build-logic/gradle-plugins/src/main/kotlin/com/pubnub/gradle/PubNubDokkaPlugin.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
package com.pubnub.gradle | ||
|
||
import org.gradle.api.Plugin | ||
import org.gradle.api.Project | ||
import org.gradle.kotlin.dsl.apply | ||
import org.gradle.kotlin.dsl.withType | ||
import org.jetbrains.dokka.gradle.DokkaPlugin | ||
import org.jetbrains.dokka.gradle.DokkaTask | ||
import org.jetbrains.dokka.gradle.DokkaTaskPartial | ||
|
||
class PubNubDokkaPlugin : Plugin<Project> { | ||
override fun apply(target: Project) { | ||
with(target) { | ||
apply<DokkaPlugin>() | ||
|
||
tasks.withType<DokkaTask>().configureEach { task -> | ||
task.notCompatibleWithConfigurationCache("https://github.com/Kotlin/dokka/issues/2231") | ||
task.dokkaSourceSets.configureEach { sourceSetBuilder -> | ||
sourceSetBuilder.perPackageOption { | ||
it.matchingRegex.set(".*internal.*") | ||
it.suppress.set(true) | ||
} | ||
sourceSetBuilder.skipEmptyPackages.set(true) | ||
} | ||
} | ||
|
||
tasks.withType<DokkaTaskPartial>().configureEach { task -> | ||
task.dokkaSourceSets.configureEach { | ||
it.perPackageOption { | ||
it.matchingRegex.set(".*internal.*") | ||
it.suppress.set(true) | ||
} | ||
it.skipEmptyPackages.set(true) | ||
} | ||
} | ||
} | ||
} | ||
} |
Oops, something went wrong.