Skip to content

Commit

Permalink
Use main as the permanent default branch (kordlib#831)
Browse files Browse the repository at this point in the history
  • Loading branch information
lukellmann authored Jun 17, 2023
1 parent c47d45c commit b63b009
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 6 deletions.
8 changes: 5 additions & 3 deletions .github/workflows/docs-ci.yml
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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
Expand Down
7 changes: 5 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.__
Expand Down Expand Up @@ -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)

Expand Down
9 changes: 8 additions & 1 deletion buildSrc/src/main/kotlin/Projects.kt
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down
3 changes: 3 additions & 0 deletions gradle.properties
Original file line number Diff line number Diff line change
@@ -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
Expand Down

0 comments on commit b63b009

Please sign in to comment.