Skip to content

Commit

Permalink
Start extracting common versions
Browse files Browse the repository at this point in the history
Issue: #428
  • Loading branch information
mlopatkin committed Jan 25, 2025
1 parent 3e06925 commit a825dd0
Show file tree
Hide file tree
Showing 4 changed files with 31 additions and 3 deletions.
11 changes: 11 additions & 0 deletions .github/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
import name.mlopatkin.gradleplugins.freemarker.FreeMarkerTask
import java.io.StringReader
import java.util.Properties

/*
* Copyright 2025 the Andlogview authors
Expand Down Expand Up @@ -27,6 +29,15 @@ val buildWorkflows = tasks.register<FreeMarkerTask>("buildWorkflows") {
include("*.ftl")
}
outputDirectory = layout.buildDirectory.dir("generated/$name")

val fileContents = providers.fileContents(layout.projectDirectory.file("versions.properties")).asText.map {
val props = Properties()
props.load(StringReader(it))

return@map props.entries.associate { (k, v) -> k.toString() to v.toString() }.toSortedMap()
}

definitions = fileContents
}


Expand Down
17 changes: 17 additions & 0 deletions .github/versions.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
#
# Copyright 2025 the Andlogview authors
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#

ANDLOGVIEW_ENV_VERSION=sha256:5d34e961a07019b09599025c5de65f3e7d6a44b80072f92114e35bde212e41b8
2 changes: 1 addition & 1 deletion .github/workflow-templates/pull-request-test.yaml.ftl
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ on:
jobs:
run-precommit-tests:
runs-on: ubuntu-latest
container: ghcr.io/mlopatkin/andlogview-build-environment@sha256:5d34e961a07019b09599025c5de65f3e7d6a44b80072f92114e35bde212e41b8
container: ghcr.io/mlopatkin/andlogview-build-environment@[=ANDLOGVIEW_ENV_VERSION]
env:
PYTHON_BINARY: python3
steps:
Expand Down
4 changes: 2 additions & 2 deletions .github/workflow-templates/releasing.yaml.ftl
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ env:
jobs:
build-snapshot:
runs-on: ubuntu-latest
container: ghcr.io/mlopatkin/andlogview-build-environment@sha256:5d34e961a07019b09599025c5de65f3e7d6a44b80072f92114e35bde212e41b8
container: ghcr.io/mlopatkin/andlogview-build-environment@[=ANDLOGVIEW_ENV_VERSION]
# Only build snapshots on master
if: github.ref == 'refs/heads/master'
steps:
Expand Down Expand Up @@ -96,7 +96,7 @@ jobs:

build-release:
runs-on: ubuntu-latest
container: ghcr.io/mlopatkin/andlogview-build-environment@sha256:5d34e961a07019b09599025c5de65f3e7d6a44b80072f92114e35bde212e41b8
container: ghcr.io/mlopatkin/andlogview-build-environment@[=ANDLOGVIEW_ENV_VERSION]
# Only build releases out of tags
if: github.ref_type == 'tag' && !endsWith(github.ref, '-snapshot')
steps:
Expand Down

0 comments on commit a825dd0

Please sign in to comment.