Skip to content

Commit

Permalink
Add Apollo Previews repository
Browse files Browse the repository at this point in the history
  • Loading branch information
martinbonnin committed Oct 15, 2024
1 parent ccab710 commit 6784765
Show file tree
Hide file tree
Showing 4 changed files with 82 additions and 10 deletions.
16 changes: 16 additions & 0 deletions .github/workflows/nightly.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
name: nightly

on:
schedule:
- cron: '0 3 * * *'
workflow_dispatch:

jobs:
nightly:
runs-on: macos-14
if: github.repository == 'apollographql/apollo-kotlin'
steps:
- run: |
gh workflow run preview.yml -f branch=main -f prerelease=$(date '+%Y.%m.%d').${GITHUB_SHA}
env:
GITHUB_TOKEN: ${{ github.token }}
35 changes: 35 additions & 0 deletions .github/workflows/preview.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: preview

on:
workflow_dispatch:
inputs:
branch:
description: 'The branch to build'
required: true
default: 'main'
type: string
prerelease:
description: 'The pre-release version'
required: true
type: string
jobs:
preview:
runs-on: macos-14
if: github.repository == 'apollographql/apollo-kotlin'
steps:
- uses: actions/setup-java@99b8673ff64fbf99d8d325f52d9a5bdedb8483e9 #v4.2.1
with:
distribution: 'temurin'
java-version: 17
- uses: gradle/actions/setup-gradle@dbbdc275be76ac10734476cc723d82dfe7ec6eda #v3.4.2
with:
gradle-home-cache-cleanup: true
- run: |
git clone --depth 1 --single-branch --branch ${{ inputs.branch }} https://github.com/$GITHUB_REPOSITORY
sed -i .old 's/VERSION_NAME=\([\.0-9]*\).*/VERSION_NAME=\1-${{ inputs.prerelease }}/g' gradle.properties
export GOOGLE_APPLICATION_CREDENTIALS=google-services.json
echo ${GOOGLE_SERVICES_JSON} > $GOOGLE_APPLICATION_CREDENTIALS
./gradlew publishAllPublicationsToApolloPreviewsRepository
env:
GOOGLE_SERVICES_JSON: ${{ secrets.GOOGLE_SERVICES_JSON }}
GITHUB_TOKEN: ${{ github.token }}
8 changes: 2 additions & 6 deletions build-logic/src/main/kotlin/Publishing.kt
Original file line number Diff line number Diff line change
Expand Up @@ -350,12 +350,8 @@ private fun Project.configurePublishingInternal() {
}

maven {
name = "repsy"
setUrl("https://repo.repsy.io/mvn/mbonnin/default")
credentials {
username = System.getenv("REPSY_USERNAME")
password = System.getenv("REPSY_PASSWORD")
}
name = "apolloPreviews"
setUrl("gcs://apollo-previews/m2")
}
}
}
Expand Down
33 changes: 29 additions & 4 deletions docs/source/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -210,19 +210,44 @@ pluginManagement {
maven {
url = uri("https://s01.oss.sonatype.org/content/repositories/snapshots/")
}
gradlePluginPortal()
mavenCentral()
// other repositories...
}
}
```

And then use the `4.0.2-SNAPSHOT` version for the plugin and libraries.

These snapshots are updated on each push to `main`.
The snapshots are updated on each push to `main` and have no retention guarantees.

Weekly snapshots for the Android Studio / IntelliJ plugin [are also available](testing/android-studio-plugin#weekly-snapshots).

## Previews

Previews are available in Apollo previews repository:

```kotlin
// build.gradle.kts
repositories {
maven {
url = uri("https://storage.googleapis.com/apollo-previews/m2/")
}
mavenCentral()
// other repositories...
}

// settings.gradle.kts
pluginManagement {
repositories {
maven {
url = uri("https://storage.googleapis.com/apollo-previews/m2/")
}
mavenCentral()
// other repositories...
}
}
```

Previews are published every night 3am UTC time. They have 1 year retention.

## Evolution policy

You can read about our evolution policy in the [dedicated page](essentials/evolution)
Expand Down

0 comments on commit 6784765

Please sign in to comment.