From 650c91d51bc04a91ca985896d6df632a1cc2e591 Mon Sep 17 00:00:00 2001 From: Spencer Brower Date: Fri, 12 Jun 2026 16:56:04 -0400 Subject: [PATCH] ci: Updated release-please. --- .github/workflows/odin.yml | 1 - .github/workflows/release-please.yml | 6 ++++-- Makefile | 11 +++-------- cmd_version.odin | 2 ++ flake.nix | 2 +- version.txt | 1 + 6 files changed, 11 insertions(+), 12 deletions(-) create mode 100644 version.txt diff --git a/.github/workflows/odin.yml b/.github/workflows/odin.yml index e6d40a1..19df8c8 100644 --- a/.github/workflows/odin.yml +++ b/.github/workflows/odin.yml @@ -26,7 +26,6 @@ jobs: - name: Build run: | - make version.odin odin build . -o:speed -out:envr - name: Test diff --git a/.github/workflows/release-please.yml b/.github/workflows/release-please.yml index 5a7cfb2..00d3c02 100644 --- a/.github/workflows/release-please.yml +++ b/.github/workflows/release-please.yml @@ -2,6 +2,8 @@ on: push: branches: - main + - dev + - odin permissions: contents: write @@ -14,7 +16,7 @@ jobs: release-please: runs-on: ubuntu-latest steps: - - uses: googleapis/release-please-action@v4 + - uses: googleapis/release-please-action@v5 with: # this assumes that you have created a personal access token # (PAT) and configured it as a GitHub action secret named @@ -22,4 +24,4 @@ jobs: token: ${{ secrets.MY_RELEASE_PLEASE_TOKEN }} # this is a built-in strategy in release-please, see "Action Inputs" # for more options - release-type: odin + release-type: simple diff --git a/Makefile b/Makefile index 11de6a4..f87baba 100644 --- a/Makefile +++ b/Makefile @@ -19,25 +19,20 @@ all: release clean $(BUILD_DIR): @mkdir -p $(BUILD_DIR) -# Generate version.odin from flake.nix -version.odin: - @echo 'Generating version.odin (v$(VERSION))...' - @printf 'package main\n\nVERSION :: "$(VERSION)"\n' > version.odin - # Build Linux AMD64 -$(LINUX_AMD64_BIN): version.odin $(BUILD_DIR) +$(LINUX_AMD64_BIN): $(BUILD_DIR) @echo "Building for Linux AMD64..." odin build . -target:linux_amd64 -o:speed -out:$(LINUX_AMD64_BIN) @echo "Built $(LINUX_AMD64_BIN)" # Build Linux ARM64 -$(LINUX_ARM64_BIN): version.odin $(BUILD_DIR) +$(LINUX_ARM64_BIN): $(BUILD_DIR) @echo "Building for Linux ARM64..." odin build . -target:linux_arm64 -o:speed -out:$(LINUX_ARM64_BIN) @echo "Built $(LINUX_ARM64_BIN)" # Build Darwin ARM64 (Mac) -$(DARWIN_ARM64_BIN): version.odin $(BUILD_DIR) +$(DARWIN_ARM64_BIN): $(BUILD_DIR) @echo "Building for Darwin ARM64..." odin build . -target:darwin_arm64 -o:speed -out:$(DARWIN_ARM64_BIN) @echo "Built $(DARWIN_ARM64_BIN)" diff --git a/cmd_version.odin b/cmd_version.odin index 1145209..3bf94a1 100644 --- a/cmd_version.odin +++ b/cmd_version.odin @@ -2,6 +2,8 @@ package main import "core:fmt" +VERSION :: #load("version.txt", string) + cmd_version :: proc(cmd: ^Command) { if has_flag(cmd, "long") || has_flag(cmd, "l") { fmt.printf("envr version %s\n", VERSION) diff --git a/flake.nix b/flake.nix index 93126f4..983cfc8 100644 --- a/flake.nix +++ b/flake.nix @@ -69,7 +69,7 @@ buildPhase = '' runHook preBuild - make version.odin + echo '${version}' > version.txt odin build . -o:speed -out:${pname} runHook postBuild ''; diff --git a/version.txt b/version.txt new file mode 100644 index 0000000..0ea3a94 --- /dev/null +++ b/version.txt @@ -0,0 +1 @@ +0.2.0