ci: Updated release-please.

This commit is contained in:
2026-06-12 16:56:04 -04:00
parent ad3ce748bb
commit 650c91d51b
6 changed files with 11 additions and 12 deletions

View File

@@ -26,7 +26,6 @@ jobs:
- name: Build - name: Build
run: | run: |
make version.odin
odin build . -o:speed -out:envr odin build . -o:speed -out:envr
- name: Test - name: Test

View File

@@ -2,6 +2,8 @@ on:
push: push:
branches: branches:
- main - main
- dev
- odin
permissions: permissions:
contents: write contents: write
@@ -14,7 +16,7 @@ jobs:
release-please: release-please:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- uses: googleapis/release-please-action@v4 - uses: googleapis/release-please-action@v5
with: with:
# this assumes that you have created a personal access token # this assumes that you have created a personal access token
# (PAT) and configured it as a GitHub action secret named # (PAT) and configured it as a GitHub action secret named
@@ -22,4 +24,4 @@ jobs:
token: ${{ secrets.MY_RELEASE_PLEASE_TOKEN }} token: ${{ secrets.MY_RELEASE_PLEASE_TOKEN }}
# this is a built-in strategy in release-please, see "Action Inputs" # this is a built-in strategy in release-please, see "Action Inputs"
# for more options # for more options
release-type: odin release-type: simple

View File

@@ -19,25 +19,20 @@ all: release clean
$(BUILD_DIR): $(BUILD_DIR):
@mkdir -p $(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 # Build Linux AMD64
$(LINUX_AMD64_BIN): version.odin $(BUILD_DIR) $(LINUX_AMD64_BIN): $(BUILD_DIR)
@echo "Building for Linux AMD64..." @echo "Building for Linux AMD64..."
odin build . -target:linux_amd64 -o:speed -out:$(LINUX_AMD64_BIN) odin build . -target:linux_amd64 -o:speed -out:$(LINUX_AMD64_BIN)
@echo "Built $(LINUX_AMD64_BIN)" @echo "Built $(LINUX_AMD64_BIN)"
# Build Linux ARM64 # Build Linux ARM64
$(LINUX_ARM64_BIN): version.odin $(BUILD_DIR) $(LINUX_ARM64_BIN): $(BUILD_DIR)
@echo "Building for Linux ARM64..." @echo "Building for Linux ARM64..."
odin build . -target:linux_arm64 -o:speed -out:$(LINUX_ARM64_BIN) odin build . -target:linux_arm64 -o:speed -out:$(LINUX_ARM64_BIN)
@echo "Built $(LINUX_ARM64_BIN)" @echo "Built $(LINUX_ARM64_BIN)"
# Build Darwin ARM64 (Mac) # Build Darwin ARM64 (Mac)
$(DARWIN_ARM64_BIN): version.odin $(BUILD_DIR) $(DARWIN_ARM64_BIN): $(BUILD_DIR)
@echo "Building for Darwin ARM64..." @echo "Building for Darwin ARM64..."
odin build . -target:darwin_arm64 -o:speed -out:$(DARWIN_ARM64_BIN) odin build . -target:darwin_arm64 -o:speed -out:$(DARWIN_ARM64_BIN)
@echo "Built $(DARWIN_ARM64_BIN)" @echo "Built $(DARWIN_ARM64_BIN)"

View File

@@ -2,6 +2,8 @@ package main
import "core:fmt" import "core:fmt"
VERSION :: #load("version.txt", string)
cmd_version :: proc(cmd: ^Command) { cmd_version :: proc(cmd: ^Command) {
if has_flag(cmd, "long") || has_flag(cmd, "l") { if has_flag(cmd, "long") || has_flag(cmd, "l") {
fmt.printf("envr version %s\n", VERSION) fmt.printf("envr version %s\n", VERSION)

View File

@@ -69,7 +69,7 @@
buildPhase = '' buildPhase = ''
runHook preBuild runHook preBuild
make version.odin echo '${version}' > version.txt
odin build . -o:speed -out:${pname} odin build . -o:speed -out:${pname}
runHook postBuild runHook postBuild
''; '';

1
version.txt Normal file
View File

@@ -0,0 +1 @@
0.2.0