Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(scripts): kotlin release #2649

Merged
merged 6 commits into from
Feb 2, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -384,7 +384,7 @@ jobs:

codegen:
runs-on: ubuntu-22.04
timeout-minutes: 10
timeout-minutes: 15
needs:
- setup
- client_gen
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,6 @@ jobs:
name: Publish to Sonatype
runs-on: ubuntu-22.04
if: "startsWith(github.event.head_commit.message, 'chore: release')"
env:
ORG_GRADLE_PROJECT_mavenCentralUsername: ${{ secrets.SONATYPE_NEXUS_USERNAME }}
ORG_GRADLE_PROJECT_mavenCentralPassword: ${{ secrets.SONATYPE_NEXUS_PASSWORD }}
ORG_GRADLE_PROJECT_signingInMemoryKey: ${{ secrets.SIGNING_PRIVATE_KEY }}
ORG_GRADLE_PROJECT_signingInMemoryKeyId: ${{ secrets.SIGNING_PRIVATE_KEY_ID }}
ORG_GRADLE_PROJECT_signingInMemoryKeyPassword: ${{ secrets.SIGNING_PRIVATE_KEY_PASSWORD }}
steps:
- name: Checkout
uses: actions/checkout@v4
Expand All @@ -25,10 +19,15 @@ jobs:
with:
distribution: zulu
java-version-file: .java-version
cache: gradle

- name: Setup Gradle
uses: gradle/actions/setup-gradle@v3

- name: Upload Artifacts
run: ./gradlew publishAllPublicationsToMavenCentral --no-configuration-cache
env:
ORG_GRADLE_PROJECT_mavenCentralUsername: ${{ secrets.SONATYPE_NEXUS_USERNAME }}
ORG_GRADLE_PROJECT_mavenCentralPassword: ${{ secrets.SONATYPE_NEXUS_PASSWORD }}
ORG_GRADLE_PROJECT_signingInMemoryKey: ${{ secrets.SIGNING_PRIVATE_KEY }}
ORG_GRADLE_PROJECT_signingInMemoryKeyId: ${{ secrets.SIGNING_PRIVATE_KEY_ID }}
ORG_GRADLE_PROJECT_signingInMemoryKeyPassword: ${{ secrets.SIGNING_PRIVATE_KEY_PASSWORD }}
2 changes: 1 addition & 1 deletion clients/algoliasearch-client-java/api/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ plugins {
}

repositories {
maven { url = "https://oss.sonatype.org/content/repositories/snapshots/" }
maven { url = "https://oss.sonatype.org/content/repositories/" }
mavenCentral()
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ jobs:
publish:
name: Publish to Sonatype
runs-on: macos-13
if: "startsWith(github.event.head_commit.message, 'chore: release')"
steps:
- name: Checkout
uses: actions/checkout@v4
Expand All @@ -22,25 +23,11 @@ jobs:
- name: Setup Gradle
uses: gradle/actions/setup-gradle@v3

- name: Compile
run: ./gradlew assemble

- name: Upload Artifacts
run: ./gradlew publish
run: ./gradlew publishAllPublicationsToMavenCentral --no-configuration-cache
env:
ORG_GRADLE_PROJECT_mavenCentralUsername: ${{ secrets.SONATYPE_NEXUS_USERNAME }}
ORG_GRADLE_PROJECT_mavenCentralPassword: ${{ secrets.SONATYPE_NEXUS_PASSWORD }}
ORG_GRADLE_PROJECT_signingInMemoryKey: ${{ secrets.SIGNING_PRIVATE_KEY }}
ORG_GRADLE_PROJECT_signingInMemoryKeyId: ${{ secrets.SIGNING_PRIVATE_KEY_ID }}
ORG_GRADLE_PROJECT_signingInMemoryKeyPassword: ${{ secrets.SIGNING_PRIVATE_KEY_PASSWORD }}

- name: Check Snapshot
id: snapshot
run: |
if [[ $(cat ./gradle.properties | grep 'VERSION_NAME=.*-SNAPSHOT') ]]; then
echo "IS_SNAPSHOT=true" >> $GITHUB_OUTPUT
fi
- name: Release Artifacts
if: ${{ steps.snapshot.outputs.IS_SNAPSHOT != 'true' }}
run: ./gradlew closeAndReleaseRepository
2 changes: 1 addition & 1 deletion scripts/ci/codegen/pushSpecsToNewWorldDocs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ async function pushToNewWorld(): Promise<void> {
const tempGitDir = resolve(process.env.RUNNER_TEMP!, repository);
await fsp.rm(tempGitDir, { force: true, recursive: true });
await run(`git clone --depth 1 ${githubURL} ${tempGitDir}`);
await run(`git checkout -B ${targetBranch}`);
await run(`git checkout -B ${targetBranch}`, { cwd: tempGitDir });

const dest = toAbsolutePath(`${tempGitDir}/apps/docs/public/specs`);
await emptyDirExceptForDotGit(dest);
Expand Down
5 changes: 3 additions & 2 deletions scripts/ci/codegen/waitForAllReleases.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ function getAllRuns(languages: Language[], workflowIDs: Array<number | undefined
}

// check that the run was created less than 10 minutes ago
if (Date.now() - Date.parse(ciRun.data.workflow_runs[0].created_at) > 10 * 60 * 1000) {
if (Date.now() - Date.parse(ciRun.data.workflow_runs[0].created_at) > 15 * 60 * 1000) {
return null;
}

Expand Down Expand Up @@ -79,7 +79,8 @@ async function waitForAllReleases(languages: Language[]): Promise<void> {
const failures: Language[] = [];

const start = Date.now();
while (Date.now() - start < 1000 * 60 * 5) {
// kotlin release can take a long time
while (Date.now() - start < 1000 * 60 * 10) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🤣

Copy link
Collaborator Author

@millotp millotp Feb 2, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it's running on a macos github actions !

const runs = await getAllRuns(languages, workflowIDs);
for (let i = 0; i < languages.length; i++) {
if (runs[i] === null) {
Expand Down
1 change: 1 addition & 0 deletions scripts/common.ts
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,7 @@ export function toAbsolutePath(ppath: string): string {
export async function gitCommit({
message,
coAuthors,
// the cwd must be absolute !
cwd = ROOT_DIR,
}: {
message: string;
Expand Down
Loading