Skip to content

Commit

Permalink
More releasing fixing... (#22)
Browse files Browse the repository at this point in the history
* try only releasing JVM when 'build' workflow has passed

* enable me.qoomon.git-versioning plugin
  • Loading branch information
aSemy authored Oct 24, 2022
1 parent b299554 commit f461758
Show file tree
Hide file tree
Showing 6 changed files with 32 additions and 25 deletions.
4 changes: 4 additions & 0 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,18 @@ on:
branches:
- main
- release/*
workflow_dispatch:


concurrency:
group: '${{ github.workflow }} @ ${{ github.event.pull_request.head.label || github.head_ref || github.ref }}'
cancel-in-progress: true


permissions:
contents: read


jobs:

linux:
Expand Down
33 changes: 9 additions & 24 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
@@ -1,34 +1,18 @@
name: release

on:
push:
tags:
- v**
branches:
- main
- release/*
workflow_dispatch:

workflow_run:
workflows: [ "build" ]
branches: [ main ]
types:
- completed

jobs:
version:
runs-on: ubuntu-latest
outputs:
version: ${{ steps.semver.outputs.version }}
steps:
- name: Checkout the repo
uses: actions/checkout@v3
with:
fetch-depth: 0

- name: Calculate version
id: semver
uses: paulhatch/semantic-version@v4
with:
format: "${major}.${minor}.${patch}-SNAPSHOT"
jobs:

release:
needs: version
runs-on: ubuntu-latest
steps:

Expand All @@ -55,8 +39,9 @@ jobs:

env:
ORG_GRADLE_PROJECT_ks3_enableKotlinMultiplatformJvm: true
ORG_GRADLE_PROJECT_ks3_enableKotlinMultiplatformJs: true
ORG_GRADLE_PROJECT_ks3_enableKotlinMultiplatformNative: true
ORG_GRADLE_PROJECT_ks3_enableKotlinMultiplatformJs: false
ORG_GRADLE_PROJECT_ks3_enableKotlinMultiplatformNative: false

ORG_GRADLE_PROJECT_signingKey: ${{ secrets.SIGNING_KEY }}
ORG_GRADLE_PROJECT_signingPassword: ${{ secrets.SIGNING_PASSWORD }}
ORG_GRADLE_PROJECT_ossrhUsername: ${{ secrets.OSSRH_USERNAME }}
Expand Down
1 change: 1 addition & 0 deletions build-logic/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ dependencies {
implementation(libs.gradlePlugin.kotlin)
implementation(libs.gradlePlugin.kotlinSerialization)
implementation(libs.gradlePlugin.testlogger)
implementation(libs.gradlePlugin.gitVersioning)
implementation(libs.gradlePlugin.kotest)
}

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
package ks3.conventions

plugins {
id("me.qoomon.git-versioning")
}
11 changes: 10 additions & 1 deletion build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,11 +1,20 @@
plugins {
id("ks3.conventions.base")
id("ks3.conventions.git-versioning")
idea
}

group = "io.ks3"
version = "0.0.1-SNAPSHOT"
version = "0.0.0-SNAPSHOT"
gitVersioning.apply {
refs {
branch(".+") { version = "\${ref}-SNAPSHOT" }
tag("v(?<version>.*)") { version = "\${ref.version}" }
}

// optional fallback configuration in case of no matching ref configuration
rev { version = "\${commit}" }
}

idea {
module {
Expand Down
3 changes: 3 additions & 0 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ kotest-springExtension = "1.1.2"
kotest-wiremockExtension = "1.0.3"

gradlePlugin-testlogger = "3.2.0"
gradlePlugin-gitVersioning = "6.3.4"


[libraries]
Expand Down Expand Up @@ -55,6 +56,8 @@ gradlePlugin-testlogger = { module = "com.adarshr:gradle-test-logger-plugin", ve

gradlePlugin-kotest = { module = "io.kotest:kotest-framework-multiplatform-plugin-gradle", version.ref = "kotest" }

gradlePlugin-gitVersioning = { module = "me.qoomon:gradle-git-versioning-plugin", version.ref = "gradlePlugin-gitVersioning" }

[bundles]


Expand Down

0 comments on commit f461758

Please sign in to comment.