5 Commits
Author SHA1 Message Date
Daniel SamsonandClaude Opus 4.5 6b28dca798 feat: dynamic version from Maven resource filtering
- Add VersionProvider class that reads version from version.properties
- Enable Maven resource filtering for version.properties
- Version is now automatically synced with pom.xml

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-22 09:14:08 +00:00
Daniel SamsonandClaude Opus 4.5 a72dfd2e4c chore: bump version to 0.1.5
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-22 09:02:01 +00:00
Daniel SamsonandClaude Opus 4.5 1370ed6deb fix(ci): integrate homebrew update into release workflow
GITHUB_TOKEN events don't trigger other workflows, so the separate
update-homebrew workflow never ran. Move the logic directly into
the release workflow.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-22 09:01:41 +00:00
Daniel SamsonandClaude Opus 4.5 9833d3a2ec fix(ci): use macos-15-intel instead of deprecated macos-13
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-22 08:50:38 +00:00
Daniel SamsonandClaude Opus 4.5 e5714737b1 chore: bump version to 0.1.4
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-22 08:43:42 +00:00
10 changed files with 187 additions and 109 deletions

No files matched your search

+87 -1
View File
@@ -20,7 +20,7 @@ jobs:
artifact: barn-linux-arm64
- os: macos-latest
artifact: barn-macos-arm64
- os: macos-13
- os: macos-15-intel
artifact: barn-macos-x64
- os: windows-latest
artifact: barn-windows-x64
@@ -118,3 +118,89 @@ jobs:
files: release/*
draft: false
prerelease: ${{ contains(github.ref, '-') }}
- name: Get checksums for Homebrew
id: checksums
run: |
cd release
echo "macos_arm64_sha=$(grep barn-macos-arm64 SHA256SUMS | awk '{print $1}')" >> $GITHUB_OUTPUT
echo "macos_x64_sha=$(grep barn-macos-x64 SHA256SUMS | awk '{print $1}')" >> $GITHUB_OUTPUT
echo "linux_arm64_sha=$(grep barn-linux-arm64 SHA256SUMS | awk '{print $1}')" >> $GITHUB_OUTPUT
echo "linux_x64_sha=$(grep barn-linux-x64 SHA256SUMS | awk '{print $1}')" >> $GITHUB_OUTPUT
- name: Checkout homebrew tap
uses: actions/checkout@v4
with:
repository: samson-media/homebrew-tap
token: ${{ secrets.HOMEBREW_TAP_TOKEN }}
path: homebrew-tap
- name: Update Homebrew formula
env:
VERSION: ${{ steps.version.outputs.version }}
MACOS_ARM64_SHA: ${{ steps.checksums.outputs.macos_arm64_sha }}
MACOS_X64_SHA: ${{ steps.checksums.outputs.macos_x64_sha }}
LINUX_ARM64_SHA: ${{ steps.checksums.outputs.linux_arm64_sha }}
LINUX_X64_SHA: ${{ steps.checksums.outputs.linux_x64_sha }}
run: |
cat > homebrew-tap/Formula/barn.rb << EOF
class Barn < Formula
desc "Cross-platform job daemon for media processing"
homepage "https://github.com/samson-media/barn"
version "${VERSION}"
license "MIT"
on_macos do
on_arm do
url "https://github.com/samson-media/barn/releases/download/v${VERSION}/barn-macos-arm64"
sha256 "${MACOS_ARM64_SHA}"
def install
bin.install "barn-macos-arm64" => "barn"
end
end
on_intel do
url "https://github.com/samson-media/barn/releases/download/v${VERSION}/barn-macos-x64"
sha256 "${MACOS_X64_SHA}"
def install
bin.install "barn-macos-x64" => "barn"
end
end
end
on_linux do
on_arm do
url "https://github.com/samson-media/barn/releases/download/v${VERSION}/barn-linux-arm64"
sha256 "${LINUX_ARM64_SHA}"
def install
bin.install "barn-linux-arm64" => "barn"
end
end
on_intel do
url "https://github.com/samson-media/barn/releases/download/v${VERSION}/barn-linux-x64"
sha256 "${LINUX_X64_SHA}"
def install
bin.install "barn-linux-x64" => "barn"
end
end
end
test do
assert_match "barn", shell_output("#{bin}/barn --version")
end
end
EOF
- name: Commit and push to Homebrew tap
run: |
cd homebrew-tap
git config user.name "GitHub Actions"
git config user.email "actions@github.com"
git add Formula/barn.rb
git diff --staged --quiet || git commit -m "Update barn to ${{ steps.version.outputs.version }}"
git push
-106
View File
@@ -1,106 +0,0 @@
name: Update Homebrew
on:
release:
types: [published]
jobs:
update-homebrew:
runs-on: ubuntu-latest
steps:
- name: Get release info
id: release
run: |
VERSION=${GITHUB_REF#refs/tags/v}
echo "version=$VERSION" >> $GITHUB_OUTPUT
# Get checksums from release
curl -sL "https://github.com/${{ github.repository }}/releases/download/v${VERSION}/SHA256SUMS" -o SHA256SUMS
cat SHA256SUMS
MACOS_ARM64_SHA=$(grep barn-macos-arm64 SHA256SUMS | awk '{print $1}')
MACOS_X64_SHA=$(grep barn-macos-x64 SHA256SUMS | awk '{print $1}')
LINUX_ARM64_SHA=$(grep barn-linux-arm64 SHA256SUMS | awk '{print $1}')
LINUX_X64_SHA=$(grep barn-linux-x64 SHA256SUMS | awk '{print $1}')
echo "macos_arm64_sha=$MACOS_ARM64_SHA" >> $GITHUB_OUTPUT
echo "macos_x64_sha=$MACOS_X64_SHA" >> $GITHUB_OUTPUT
echo "linux_arm64_sha=$LINUX_ARM64_SHA" >> $GITHUB_OUTPUT
echo "linux_x64_sha=$LINUX_X64_SHA" >> $GITHUB_OUTPUT
- name: Checkout homebrew tap
uses: actions/checkout@v4
with:
repository: samson-media/homebrew-tap
token: ${{ secrets.HOMEBREW_TAP_TOKEN }}
path: homebrew-tap
- name: Update formula
env:
VERSION: ${{ steps.release.outputs.version }}
MACOS_ARM64_SHA: ${{ steps.release.outputs.macos_arm64_sha }}
MACOS_X64_SHA: ${{ steps.release.outputs.macos_x64_sha }}
LINUX_ARM64_SHA: ${{ steps.release.outputs.linux_arm64_sha }}
LINUX_X64_SHA: ${{ steps.release.outputs.linux_x64_sha }}
run: |
cat > homebrew-tap/Formula/barn.rb << EOF
class Barn < Formula
desc "Cross-platform job daemon for media processing"
homepage "https://github.com/samson-media/barn"
version "${VERSION}"
license "MIT"
on_macos do
on_arm do
url "https://github.com/samson-media/barn/releases/download/v${VERSION}/barn-macos-arm64"
sha256 "${MACOS_ARM64_SHA}"
def install
bin.install "barn-macos-arm64" => "barn"
end
end
on_intel do
url "https://github.com/samson-media/barn/releases/download/v${VERSION}/barn-macos-x64"
sha256 "${MACOS_X64_SHA}"
def install
bin.install "barn-macos-x64" => "barn"
end
end
end
on_linux do
on_arm do
url "https://github.com/samson-media/barn/releases/download/v${VERSION}/barn-linux-arm64"
sha256 "${LINUX_ARM64_SHA}"
def install
bin.install "barn-linux-arm64" => "barn"
end
end
on_intel do
url "https://github.com/samson-media/barn/releases/download/v${VERSION}/barn-linux-x64"
sha256 "${LINUX_X64_SHA}"
def install
bin.install "barn-linux-x64" => "barn"
end
end
end
test do
assert_match "barn", shell_output("#{bin}/barn --version")
end
end
EOF
- name: Commit and push
run: |
cd homebrew-tap
git config user.name "GitHub Actions"
git config user.email "actions@github.com"
git add Formula/barn.rb
git commit -m "Update barn to ${{ steps.release.outputs.version }}"
git push
+22
View File
@@ -5,6 +5,25 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/),
and this project adheres to [Semantic Versioning](https://semver.org/).
## [0.1.6] - 2026-01-22
### Added
- Intel Mac (x86_64) support
### Fixed
- Homebrew tap now auto-updates on release
- Version string now matches release tag
## [0.1.5] - 2026-01-22
### Fixed
- Version string was hardcoded (broken release)
## [0.1.4] - 2026-01-22
### Added
- Intel Mac (x86_64) support (release failed)
## [0.1.3] - 2026-01-22
### Fixed
@@ -43,6 +62,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/).
- Jobs that fail to start now properly transition to FAILED state
- Startup errors are written to stderr.log for visibility
[0.1.6]: https://github.com/samson-media/barn/releases/tag/v0.1.6
[0.1.5]: https://github.com/samson-media/barn/releases/tag/v0.1.5
[0.1.4]: https://github.com/samson-media/barn/releases/tag/v0.1.4
[0.1.3]: https://github.com/samson-media/barn/releases/tag/v0.1.3
[0.1.2]: https://github.com/samson-media/barn/releases/tag/v0.1.2
[0.1.1]: https://github.com/samson-media/barn/releases/tag/v0.1.1
+17 -1
View File
@@ -6,7 +6,7 @@
<groupId>com.samsonmedia</groupId>
<artifactId>barn</artifactId>
<version>0.1.3</version>
<version>0.1.6</version>
<packaging>jar</packaging>
<name>Barn</name>
@@ -121,6 +121,22 @@
</dependencies>
<build>
<resources>
<resource>
<directory>src/main/resources</directory>
<filtering>true</filtering>
<includes>
<include>version.properties</include>
</includes>
</resource>
<resource>
<directory>src/main/resources</directory>
<filtering>false</filtering>
<excludes>
<exclude>version.properties</exclude>
</excludes>
</resource>
</resources>
<plugins>
<!-- Compiler -->
<plugin>
@@ -13,7 +13,7 @@ import picocli.CommandLine.Spec;
@Command(
name = "barn",
mixinStandardHelpOptions = true,
version = "barn 0.1.2",
versionProvider = VersionProvider.class,
description = "Cross-platform job daemon for media processing",
subcommands = {
RunCommand.class,
@@ -0,0 +1,30 @@
package com.samsonmedia.barn.cli;
import java.io.IOException;
import java.io.InputStream;
import java.util.Properties;
import picocli.CommandLine.IVersionProvider;
/**
* Provides version information from the version.properties resource file.
*
* <p>The version is injected at build time via Maven resource filtering.
*/
public final class VersionProvider implements IVersionProvider {
@Override
public String[] getVersion() {
String version = "unknown";
try (InputStream is = getClass().getResourceAsStream("/version.properties")) {
if (is != null) {
Properties props = new Properties();
props.load(is);
version = props.getProperty("version", "unknown");
}
} catch (IOException e) {
// Fall back to unknown
}
return new String[]{"barn " + version};
}
}
@@ -1,4 +1,9 @@
[
{
"name": "com.samsonmedia.barn.cli.VersionProvider",
"allDeclaredConstructors": true,
"allPublicConstructors": true
},
{
"name": "ch.qos.logback.core.status.NopStatusListener",
"allDeclaredConstructors": true,
@@ -2,6 +2,7 @@
"resources": {
"includes": [
{"pattern": "logback.xml"},
{"pattern": "version.properties"},
{"pattern": "META-INF/.*"}
]
},
+1
View File
@@ -0,0 +1 @@
version=${project.version}
@@ -0,0 +1,23 @@
package com.samsonmedia.barn.cli;
import static org.assertj.core.api.Assertions.assertThat;
import org.junit.jupiter.api.Test;
class VersionProviderTest {
@Test
void getVersion_shouldReturnVersionFromProperties() {
// Arrange
var provider = new VersionProvider();
// Act
String[] version = provider.getVersion();
// Assert
assertThat(version).hasSize(1);
assertThat(version[0]).startsWith("barn ");
assertThat(version[0]).doesNotContain("unknown");
assertThat(version[0]).doesNotContain("${");
}
}