Skip to content

Commit

Permalink
Add Apollo Previews repository (#6204)
Browse files Browse the repository at this point in the history
* Add Apollo Previews repository

* Remove the SHA1 from the nightly as there's no directory listing in GCS and it's a bit painful to guess

* tweak README
  • Loading branch information
martinbonnin authored Oct 15, 2024
1 parent ccab710 commit bdc678c
Show file tree
Hide file tree
Showing 5 changed files with 87 additions and 12 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')
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 }}
7 changes: 5 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,11 @@
[![Slack](https://img.shields.io/static/v1?label=kotlinlang&message=apollo-kotlin&color=A97BFF&logo=slack&style=flat-square)](https://app.slack.com/client/T09229ZC6/C01A6KM1SBZ)
[![Discord](https://img.shields.io/discord/1022972389463687228.svg?color=7389D8&labelColor=6A7EC2&logo=discord&logoColor=ffffff&style=flat-square)](https://discord.com/invite/graphos)

[![Maven Central](https://img.shields.io/maven-central/v/com.apollographql.apollo/apollo-api?style=flat-square)](https://central.sonatype.com/namespace/com.apollographql.apollo)
[![OSS Snapshots](https://img.shields.io/nexus/s/com.apollographql.apollo/apollo-api?server=https%3A%2F%2Fs01.oss.sonatype.org&label=oss-snapshots&style=flat-square)](https://s01.oss.sonatype.org/content/repositories/snapshots/com/apollographql/apollo/)
[![OSS Snapshots](https://img.shields.io/maven-metadata/v?metadataUrl=https%3A%2F%2Fs01.oss.sonatype.org%2Fcontent%2Frepositories%2Fsnapshots%2Fcom%2Fapollographql%2Fapollo%2Fapollo-api-jvm%2Fmaven-metadata.xml&style=flat-square&label=oss-snapshots&color=%2315252D
)](https://s01.oss.sonatype.org/content/repositories/snapshots/com/apollographql/apollo/)
[![Apollo Preview](https://img.shields.io/maven-metadata/v?metadataUrl=https%3A%2F%2Fstorage.googleapis.com%2Fapollo-previews%2Fm2%2Fcom%2Fapollographql%2Fapollo%2Fapollo-api-jvm%2Fmaven-metadata.xml&style=flat-square&label=apollo-previews&color=%23365E72)](https://storage.googleapis.com/apollo-previews/)
[![Maven Central](https://img.shields.io/maven-metadata/v?metadataUrl=https%3A%2F%2Frepo1.maven.org%2Fmaven2%2Fcom%2Fapollographql%2Fapollo%2Fapollo-api-jvm%2Fmaven-metadata.xml&style=flat-square&label=maven-central&color=%235C96B2
)](https://central.sonatype.com/namespace/com.apollographql.apollo)

[![Revved up by Develocity](https://img.shields.io/badge/Revved%20up%20by-Develocity-06A0CE?logo=Gradle&labelColor=02303A&style=flat-square)](https://ge.apollographql.com/scans)

Expand Down
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. You can get them by replacing `-SNAPSHOT` with the desired date (e.g. `4.0.2-2024.10.05`). 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 bdc678c

Please sign in to comment.