From 71574f240bb24bf1258c99f834c4c1174f18e9a2 Mon Sep 17 00:00:00 2001 From: Eric Coissac Date: Thu, 5 Feb 2026 17:53:52 +0100 Subject: [PATCH] Update version and add CI tests Update version to 4.4.5 and add a test job in the release workflow to ensure tests pass before creating a release. --- .github/workflows/release.yml | 54 +++++++++++++++++++++++++---------- pkg/obioptions/version.go | 2 +- version.txt | 2 +- 3 files changed, 41 insertions(+), 17 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 569d2d7..df33d53 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -9,7 +9,22 @@ permissions: contents: write jobs: + # First run tests + test: + runs-on: ubuntu-latest + steps: + - name: Setup Go + uses: actions/setup-go@v5 + with: + go-version: "1.23" + - name: Checkout obitools4 project + uses: actions/checkout@v4 + - name: Run tests + run: make githubtests + + # Then create release only if tests pass create-release: + needs: test runs-on: ubuntu-latest steps: - name: Checkout code @@ -30,68 +45,77 @@ jobs: echo "tag_name=Release_$TAG" >> $GITHUB_OUTPUT - name: Build binaries for multiple platforms + env: + VERSION: ${{ steps.get_version.outputs.version }} run: | - VERSION=${{ steps.get_version.outputs.version }} mkdir -p release - # Get list of obitools to build - OBITOOLS=$(ls -d cmd/obitools/*/ | xargs -n 1 basename) - # Build for Linux AMD64 echo "Building for Linux AMD64..." - GOOS=linux GOARCH=amd64 make obitools + GOOS=linux GOARCH=amd64 make cd build for binary in *; do tar -czf ../release/${binary}_${VERSION}_linux_amd64.tar.gz ${binary} done cd .. - rm -rf build/* + rm -rf build + # Build for Linux ARM64 echo "Building for Linux ARM64..." - GOOS=linux GOARCH=arm64 make obitools + GOOS=linux GOARCH=arm64 make cd build for binary in *; do tar -czf ../release/${binary}_${VERSION}_linux_arm64.tar.gz ${binary} done cd .. - rm -rf build/* + rm -rf build + # Build for macOS AMD64 (Intel) echo "Building for macOS AMD64..." - GOOS=darwin GOARCH=amd64 make obitools + GOOS=darwin GOARCH=amd64 make cd build for binary in *; do tar -czf ../release/${binary}_${VERSION}_darwin_amd64.tar.gz ${binary} done cd .. - rm -rf build/* + rm -rf build + # Build for macOS ARM64 (Apple Silicon) echo "Building for macOS ARM64..." - GOOS=darwin GOARCH=arm64 make obitools + GOOS=darwin GOARCH=arm64 make cd build for binary in *; do tar -czf ../release/${binary}_${VERSION}_darwin_arm64.tar.gz ${binary} done cd .. - rm -rf build/* + rm -rf build + # Build for Windows AMD64 echo "Building for Windows AMD64..." - GOOS=windows GOARCH=amd64 make obitools + GOOS=windows GOARCH=amd64 make cd build for binary in *; do - zip ../release/${binary}_${VERSION}_windows_amd64.zip ${binary}.exe + # Windows binaries have .exe extension + if [ -f "${binary}.exe" ]; then + zip ../release/${binary}_${VERSION}_windows_amd64.zip ${binary}.exe + else + zip ../release/${binary}_${VERSION}_windows_amd64.zip ${binary} + fi done cd .. + echo "Built archives:" ls -lh release/ - name: Generate Release Notes id: release_notes + env: + VERSION: ${{ steps.get_version.outputs.version }} run: | - VERSION=${{ steps.get_version.outputs.version }} PREV_TAG=$(git describe --tags --abbrev=0 HEAD^ 2>/dev/null || echo "") echo "# OBITools4 Release ${VERSION}" > release_notes.md diff --git a/pkg/obioptions/version.go b/pkg/obioptions/version.go index dfd82b0..7bb4ca8 100644 --- a/pkg/obioptions/version.go +++ b/pkg/obioptions/version.go @@ -3,7 +3,7 @@ package obioptions // Version is automatically updated by the Makefile from version.txt // The patch number (third digit) is incremented on each push to the repository -var _Version = "Release 4.4.4" +var _Version = "Release 4.4.5" // Version returns the version of the obitools package. // diff --git a/version.txt b/version.txt index cbe06cd..fa1ba04 100644 --- a/version.txt +++ b/version.txt @@ -1 +1 @@ -4.4.4 +4.4.5