Skip to content

Commit 489796c

Browse files
Merge pull request #90 from stytchauth/jordan/fix-rn-publishing
Various publishing fixes/tweaks
2 parents 4bb3924 + c00f67e commit 489796c

8 files changed

Lines changed: 34 additions & 12 deletions

File tree

.github/workflows/docs.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -167,13 +167,13 @@ jobs:
167167
xcrun docc convert source/ios/docs/StytchConsumerSDK.docc \
168168
--additional-symbol-graph-dir symbolgraphs/consumer-injected \
169169
--transform-for-static-hosting \
170-
--hosting-base-path ios/consumer \
170+
--hosting-base-path stytch-mobile/ios/consumer \
171171
--output-dir docs-output/ios/consumer
172172
173173
xcrun docc convert source/ios/docs/StytchB2BSDK.docc \
174174
--additional-symbol-graph-dir symbolgraphs/b2b-injected \
175175
--transform-for-static-hosting \
176-
--hosting-base-path ios/b2b \
176+
--hosting-base-path stytch-mobile/ios/b2b \
177177
--output-dir docs-output/ios/b2b
178178
179179
- name: Tar iOS docs (avoid colon-in-filename rejection by upload-artifact)

.github/workflows/publish.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -295,22 +295,22 @@ jobs:
295295
- name: Build consumer JS output
296296
working-directory: source/sdks
297297
run: |
298-
./gradlew :sdk:consumer-headless:assemble :sdk:consumer-headless:jsBrowserProductionLibraryDistribution
298+
./gradlew :sdk:consumer-headless:jsBrowserProductionLibraryDistribution
299299
mkdir -p $GITHUB_WORKSPACE/source/react-native/consumer/lib
300300
cp -r sdk/consumer-headless/build/dist/js/productionLibrary/consumer-headless* $GITHUB_WORKSPACE/source/react-native/consumer/lib
301301
302302
- name: Build B2B JS output
303303
working-directory: source/sdks
304304
run: |
305-
./gradlew :sdk:b2b-headless:assemble :sdk:b2b-headless:jsBrowserProductionLibraryDistribution
305+
./gradlew :sdk:b2b-headless:jsBrowserProductionLibraryDistribution
306306
mkdir -p $GITHUB_WORKSPACE/source/react-native/b2b/lib
307307
cp -r sdk/b2b-headless/build/dist/js/productionLibrary/b2b-headless* $GITHUB_WORKSPACE/source/react-native/b2b/lib
308308
309309
- name: Stamp version into package.json files
310310
run: |
311311
VERSION=$(cat version.txt)
312-
npm version "$VERSION" --no-git-tag-version --prefix source/react-native/consumer
313-
npm version "$VERSION" --no-git-tag-version --prefix source/react-native/b2b
312+
npm version "$VERSION" --no-git-tag-version --prefix source/react-native/consumer || true
313+
npm version "$VERSION" --no-git-tag-version --prefix source/react-native/b2b || true
314314
315315
- name: Install dependencies and build consumer RN package
316316
working-directory: source/react-native/consumer

README.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -366,6 +366,12 @@ Callback extensions are available on Android and JVM only. iOS uses native `asyn
366366

367367
---
368368

369+
## Documentation
370+
371+
Full API documentation is included (KDoc/JavaDoc, DocC, JSDoc) for in-editor reference, as well as hosted [here](https://stytchauth.github.io/stytch-mobile/).
372+
373+
For deeper documentation, consult our [docs site](https://stytch.com/docs).
374+
369375
## Support
370376

371377
If you have questions, found a bug or want help troubleshooting, join us in [Slack](https://stytch.com/docs/resources/support/overview) or email [support@stytch.com](mailto:support@stytch.com).

source/react-native/shared/StytchReactNative.podspec

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ package = JSON.parse(File.read(File.join(__dir__, "package.json")))
44

55
# If STYTCH_REPO_ROOT is set (local dev), use it as the path to the checked-out repo, otherwise fall back to github
66
spmUrl = ENV['STYTCH_REPO_ROOT'] ? File.join(ENV['STYTCH_REPO_ROOT'], 'source', 'ios') : 'https://github.com/stytchauth/stytch-ios-sdk'
7-
7+
spmRequirement = ENV['STYTCH_REPO_ROOT'] ? {} : {kind: 'upToNextMajorVersion', minimumVersion: package["version"]}
88
Pod::Spec.new do |s|
99
s.name = "StytchReactNative"
1010
s.version = package["version"]
@@ -23,7 +23,7 @@ Pod::Spec.new do |s|
2323

2424
spm_dependency(s,
2525
url: spmUrl,
26-
requirement: {},
26+
requirement: spmRequirement,
2727
products: ['StytchConsumerSDK'] # We're only using the shared module from this, so it doesn't matter if it's the consumer or b2b one :)
2828
)
2929

source/react-native/shared/src/app.plugin.cjs

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@
33
const { withXcodeProject } = require('@expo/config-plugins');
44
// eslint-disable-next-line @typescript-eslint/no-require-imports
55
const path = require('path');
6+
// eslint-disable-next-line @typescript-eslint/no-require-imports
7+
const { version } = require('../package.json');
68

79
// If STYTCH_REPO_ROOT is set (local dev), use it as the path to the checked-out repo.
810
// Otherwise fall back to the live GitHub URL
@@ -24,7 +26,10 @@ const addSPMDependenciesToMainTarget = (config) =>
2426
const isLocal = !!process.env.STYTCH_REPO_ROOT;
2527
const refType = isLocal ? 'XCLocalSwiftPackageReference' : 'XCRemoteSwiftPackageReference';
2628
const refKey = isLocal ? 'relativePath' : 'repositoryURL';
27-
29+
const spmRequirement = isLocal ? {} : {
30+
kind: 'upToNextMajorVersion',
31+
minimumVersion: version,
32+
};
2833
if (!xcodeProject.hash.project.objects[refType]) {
2934
xcodeProject.hash.project.objects[refType] = {};
3035
}
@@ -36,6 +41,7 @@ const addSPMDependenciesToMainTarget = (config) =>
3641
] = {
3742
isa: refType,
3843
[refKey]: spmUrl,
44+
requirement: spmRequirement,
3945
};
4046

4147
// update XCSwiftPackageProductDependency

source/sdks/build.gradle.kts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
import com.vanniktech.maven.publish.DeploymentValidation
2+
13
plugins {
24
alias(libs.plugins.android.kotlin.multiplatform.library) apply false
35
alias(libs.plugins.kotlinMultiplatform) apply false
@@ -30,7 +32,10 @@ subprojects {
3032
apply(plugin = "org.jetbrains.dokka")
3133
apply(plugin = "org.cyclonedx.bom")
3234
configure<com.vanniktech.maven.publish.MavenPublishBaseExtension> {
33-
publishToMavenCentral()
35+
publishToMavenCentral(
36+
automaticRelease = true,
37+
validateDeployment = DeploymentValidation.VALIDATED,
38+
)
3439
configure(
3540
com.vanniktech.maven.publish.KotlinMultiplatform(
3641
com.vanniktech.maven.publish.JavadocJar

source/shared/build.gradle.kts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
import com.vanniktech.maven.publish.DeploymentValidation
2+
13
plugins {
24
alias(libs.plugins.android.kotlin.multiplatform.library) apply false
35
alias(libs.plugins.kotlinMultiplatform) apply false
@@ -21,7 +23,10 @@ subprojects {
2123
plugins.withId("com.vanniktech.maven.publish") {
2224
apply(plugin = "org.cyclonedx.bom")
2325
configure<com.vanniktech.maven.publish.MavenPublishBaseExtension> {
24-
publishToMavenCentral()
26+
publishToMavenCentral(
27+
automaticRelease = true,
28+
validateDeployment = DeploymentValidation.VALIDATED,
29+
)
2530
if (!System.getenv("ORG_GRADLE_PROJECT_signingInMemoryKey").isNullOrEmpty()) {
2631
signAllPublications()
2732
}

version.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
1.0.0
1+
1.0.1

0 commit comments

Comments
 (0)