Skip to content

Commit

Permalink
Build and publish workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
Virtlink committed Jul 23, 2024
1 parent 94f970a commit 1be9a31
Show file tree
Hide file tree
Showing 4 changed files with 45 additions and 33 deletions.
30 changes: 25 additions & 5 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
@@ -1,16 +1,36 @@
---
name: Build
name: 'Build & Publish'

on: # yamllint disable-line rule:truthy
push:
branches:
- master
tags:
- "release-*.*.*"
pull_request:
branches:
- master

jobs:
build:
uses: metaborg/actions/.github/workflows/gradle-build-matrix.yaml@main
publish-snapshot:
uses: metaborg/actions/.github/workflows/gradle-publish.yaml@main
with:
gradle-command: |
gradle :publish -Pgitonium.isSnapshot=true
gradle-version-command: |
gradle -q :printVersion -Pgitonium.isSnapshot=true
if: "github.event_name == 'push' && github.ref == 'refs/heads/master'"
needs: [build]
secrets:
METABORG_ARTIFACTS_USERNAME: ${{ secrets.METABORG_ARTIFACTS_USERNAME }}
METABORG_ARTIFACTS_PASSWORD: ${{ secrets.METABORG_ARTIFACTS_PASSWORD }}
publish-release:
uses: metaborg/actions/.github/workflows/gradle-publish.yaml@main
with:
gradle-command: |
gradle :publish
gradle-version-command: |
gradle -q :printVersion
if: "github.event_name == 'push' && startsWith(github.ref, 'refs/tags/release-')"
needs: [build]
secrets:
METABORG_ARTIFACTS_USERNAME: ${{ secrets.METABORG_ARTIFACTS_USERNAME }}
METABORG_ARTIFACTS_PASSWORD: ${{ secrets.METABORG_ARTIFACTS_PASSWORD }}
11 changes: 0 additions & 11 deletions .github/workflows/dependencies.yaml

This file was deleted.

17 changes: 0 additions & 17 deletions .github/workflows/publish.yaml

This file was deleted.

20 changes: 20 additions & 0 deletions build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import org.metaborg.convention.Developer
import org.metaborg.convention.MavenPublishConventionExtension

// Workaround for issue: https://youtrack.jetbrains.com/issue/KTIJ-19369
Expand All @@ -7,15 +8,34 @@ plugins {
alias(libs.plugins.gitonium)
}

rootProjectConvention {
// This will add `publishAll` and `publish` tasks that call the `publish` task on each subproject and sub-build
registerPublishTasks.set(true)
}

allprojects {
apply(plugin = "org.metaborg.gitonium")

// Configure Gitonium before setting the version
gitonium {
mainBranch.set("master")
}

version = gitonium.version
group = "org.metaborg"

pluginManager.withPlugin("org.metaborg.convention.maven-publish") {
extensions.configure(MavenPublishConventionExtension::class.java) {
repoOwner.set("metaborg")
repoName.set("common")

metadata {
inceptionYear.set("2018")
developers.set(listOf(
Developer("gohla", "Gabriel Konat", "[email protected]"),
Developer("virtlink", "Daniel A. A. Pelsmaeker", "[email protected]"),
))
}
}
}
}

0 comments on commit 1be9a31

Please sign in to comment.