From b63b009537517edb6880e6d8b9fe93ef7c6853aa Mon Sep 17 00:00:00 2001 From: lukellmann <47486203+lukellmann@users.noreply.github.com> Date: Sat, 17 Jun 2023 15:43:29 +0200 Subject: [PATCH] Use main as the permanent default branch (#831) --- .github/workflows/docs-ci.yml | 8 +++++--- README.md | 7 +++++-- buildSrc/src/main/kotlin/Projects.kt | 9 ++++++++- gradle.properties | 3 +++ 4 files changed, 21 insertions(+), 6 deletions(-) diff --git a/.github/workflows/docs-ci.yml b/.github/workflows/docs-ci.yml index bb86568ec4e..60a35af52db 100644 --- a/.github/workflows/docs-ci.yml +++ b/.github/workflows/docs-ci.yml @@ -1,8 +1,11 @@ -# This workflow will build and deploy docs to GitHub Pages whenever something is pushed to the default branch +# This workflow will build and deploy docs to GitHub Pages whenever something is pushed to the main branch name: Docs -on: push # but only to default branch, see if below +on: + push: + branches: + - main permissions: contents: write @@ -11,7 +14,6 @@ jobs: docs: name: Build and deploy docs runs-on: ubuntu-latest - if: github.ref == format('refs/heads/{0}', github.event.repository.default_branch) concurrency: # Allow one concurrent deployment group: pages cancel-in-progress: true diff --git a/README.md b/README.md index 26e6f3bf4b1..b3cff0e195e 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,7 @@ [![Discord](https://img.shields.io/discord/556525343595298817.svg?color=&label=Kord&logo=discord&style=for-the-badge)](https://discord.gg/6jcx5ev) [![Download](https://img.shields.io/maven-central/v/dev.kord/kord-core.svg?label=Maven%20Central&style=for-the-badge)](https://search.maven.org/search?q=g:%22dev.kord%22%20AND%20a:%22kord-core%22) -[![Github CI status (branch)](https://img.shields.io/github/actions/workflow/status/kordlib/kord/deployment-ci.yml?branch=0.9.x&label=CI&style=for-the-badge)]() +[![Github CI status (branch)](https://img.shields.io/github/actions/workflow/status/kordlib/kord/deployment-ci.yml?branch=main&label=CI&style=for-the-badge)]() __Kord is still in an experimental stage, as such we can't guarantee API stability between releases. While we'd love for you to try out our library, we don't recommend you use this in production just yet.__ @@ -61,7 +61,10 @@ Replace `{version}` with the latest version number on maven central. For Snapshots replace `{version}` with `{branch}-SNAPSHOT` -e.g: `0.9.x-SNAPSHOT` for the branch `0.9.x` or `feature-mpp-SNAPSHOT` for the branch `feature/mpp` +e.g: `feature-mpp-SNAPSHOT` for the branch `feature/mpp` + +For Snapshots for the branch `main` replace `{version}` with `{nextPlannedVersion}-SNAPSHOT` (see `nextPlannedVersion` +in [`gradle.properties`](gradle.properties)) [![Download](https://img.shields.io/maven-central/v/dev.kord/kord-core.svg?label=Maven%20Central&style=for-the-badge)](https://search.maven.org/search?q=g:%22dev.kord%22%20AND%20a:%22kord-core%22) diff --git a/buildSrc/src/main/kotlin/Projects.kt b/buildSrc/src/main/kotlin/Projects.kt index 63c52546fcc..be8c41f12ee 100644 --- a/buildSrc/src/main/kotlin/Projects.kt +++ b/buildSrc/src/main/kotlin/Projects.kt @@ -13,7 +13,14 @@ private val Project.tag ?.lines() ?.single() -val Project.libraryVersion get() = tag ?: "${git("branch", "--show-current").replace('/', '-')}-SNAPSHOT" +val Project.libraryVersion + get() = tag ?: run { + val snapshotPrefix = when (val branch = git("branch", "--show-current")) { + "main" -> providers.gradleProperty("nextPlannedVersion").get() + else -> branch.replace('/', '-') + } + "$snapshotPrefix-SNAPSHOT" + } val Project.commitHash get() = git("rev-parse", "--verify", "HEAD") val Project.shortCommitHash get() = git("rev-parse", "--short", "HEAD") diff --git a/gradle.properties b/gradle.properties index ef230821e58..7aa5006edc5 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,3 +1,6 @@ +# the version that is planned to be released next, snapshot versions for the 'main' branch are based on this +nextPlannedVersion=0.10.0 + #dokka will run out of memory with the default meta space org.gradle.jvmargs=-XX:MaxMetaspaceSize=1024m org.gradle.parallel=true