Skip to content

Commit c05846b

Browse files
committed
Add GH packages publishing.
1 parent 4fa7805 commit c05846b

File tree

2 files changed

+39
-0
lines changed

2 files changed

+39
-0
lines changed

.github/workflows/publish-to-gh.yml

+31
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
name: Publish to GH Packages
2+
3+
on:
4+
pull_request:
5+
branches:
6+
- master
7+
- develop
8+
9+
workflow_dispatch:
10+
11+
jobs:
12+
build:
13+
runs-on: macOS-latest
14+
15+
steps:
16+
- uses: actions/checkout@v1
17+
- name: Set up JDK 11
18+
uses: actions/setup-java@v1
19+
with:
20+
java-version: 11
21+
- name: Build library
22+
run: ./gradlew build publishToMavenLocal -x :web3:compileTestDevelopmentExecutableKotlinJs -x :web3:compileTestKotlinJs #syncMultiPlatformLibraryDebugFrameworkIosX64
23+
- name: Publish artifacts
24+
run: ./gradlew :web3:publishKotlinMultiplatformPublicationToGitHubPackagesRepository
25+
env:
26+
GITHUB_ACTOR: ${{ secrets.GITHUB_ACTOR }}
27+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
28+
# - name: Install pods with kotlin
29+
# run: cd sample/ios-app && pod install
30+
# - name: build ios sample
31+
# run: cd sample/ios-app && set -o pipefail && xcodebuild -scheme ios-app -workspace ios-app.xcworkspace -configuration Debug -sdk iphonesimulator -arch x86_64 build CODE_SIGNING_REQUIRED=NO CODE_SIGNING_ALLOWED=NO | xcpretty

web3-build-logic/src/main/kotlin/publication-convention.gradle.kts

+8
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,14 @@ publishing {
2121
}*/
2222
repositories {
2323
mavenLocal()
24+
maven {
25+
name = "GitHubPackages"
26+
url = uri("https://maven.pkg.github.com/SmartTokenLabs/moko-web3")
27+
credentials {
28+
username = System.getenv("GITHUB_ACTOR")
29+
password = System.getenv("GITHUB_TOKEN")
30+
}
31+
}
2432
}
2533

2634
publications.withType<MavenPublication> {

0 commit comments

Comments
 (0)