From fe6d74efbf1a1bd735c4a449cc287aa651a6ef6a Mon Sep 17 00:00:00 2001 From: Eric Coissac Date: Thu, 5 Feb 2026 17:53:43 +0100 Subject: [PATCH 1/2] Add automated release workflow and update tag creation This commit introduces a new GitHub Actions workflow to automatically create releases when tags matching the pattern 'Release_*' are pushed. It also updates the Makefile to use the new tag format 'Release_' for tagging commits, ensuring consistency with the new release automation. --- .github/workflows/release.yml | 152 ++++++++++++++++++++++++++++++++++ Makefile | 7 +- 2 files changed, 156 insertions(+), 3 deletions(-) create mode 100644 .github/workflows/release.yml diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..569d2d7 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,152 @@ +name: Create Release on Tag + +on: + push: + tags: + - "Release_*" + +permissions: + contents: write + +jobs: + create-release: + runs-on: ubuntu-latest + steps: + - name: Checkout code + uses: actions/checkout@v4 + with: + fetch-depth: 0 + + - name: Setup Go + uses: actions/setup-go@v5 + with: + go-version: "1.23" + + - name: Extract version from tag + id: get_version + run: | + TAG=${GITHUB_REF#refs/tags/Release_} + echo "version=$TAG" >> $GITHUB_OUTPUT + echo "tag_name=Release_$TAG" >> $GITHUB_OUTPUT + + - name: Build binaries for multiple platforms + 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 + cd build + for binary in *; do + tar -czf ../release/${binary}_${VERSION}_linux_amd64.tar.gz ${binary} + done + cd .. + rm -rf build/* + + # Build for Linux ARM64 + echo "Building for Linux ARM64..." + GOOS=linux GOARCH=arm64 make obitools + cd build + for binary in *; do + tar -czf ../release/${binary}_${VERSION}_linux_arm64.tar.gz ${binary} + done + cd .. + rm -rf build/* + + # Build for macOS AMD64 (Intel) + echo "Building for macOS AMD64..." + GOOS=darwin GOARCH=amd64 make obitools + cd build + for binary in *; do + tar -czf ../release/${binary}_${VERSION}_darwin_amd64.tar.gz ${binary} + done + cd .. + rm -rf build/* + + # Build for macOS ARM64 (Apple Silicon) + echo "Building for macOS ARM64..." + GOOS=darwin GOARCH=arm64 make obitools + cd build + for binary in *; do + tar -czf ../release/${binary}_${VERSION}_darwin_arm64.tar.gz ${binary} + done + cd .. + rm -rf build/* + + # Build for Windows AMD64 + echo "Building for Windows AMD64..." + GOOS=windows GOARCH=amd64 make obitools + cd build + for binary in *; do + zip ../release/${binary}_${VERSION}_windows_amd64.zip ${binary}.exe + done + cd .. + + ls -lh release/ + + - name: Generate Release Notes + id: release_notes + 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 + echo "" >> release_notes.md + + if [ -n "$PREV_TAG" ]; then + echo "## Changes since ${PREV_TAG}" >> release_notes.md + echo "" >> release_notes.md + git log ${PREV_TAG}..HEAD --pretty=format:"- %s" >> release_notes.md + else + echo "## Changes" >> release_notes.md + echo "" >> release_notes.md + git log --pretty=format:"- %s" -n 20 >> release_notes.md + fi + + echo "" >> release_notes.md + echo "" >> release_notes.md + echo "## Installation" >> release_notes.md + echo "" >> release_notes.md + echo "Download the appropriate binary for your system and extract it:" >> release_notes.md + echo "" >> release_notes.md + echo "### Linux (AMD64)" >> release_notes.md + echo '```bash' >> release_notes.md + echo "tar -xzf _${VERSION}_linux_amd64.tar.gz" >> release_notes.md + echo '```' >> release_notes.md + echo "" >> release_notes.md + echo "### Linux (ARM64)" >> release_notes.md + echo '```bash' >> release_notes.md + echo "tar -xzf _${VERSION}_linux_arm64.tar.gz" >> release_notes.md + echo '```' >> release_notes.md + echo "" >> release_notes.md + echo "### macOS (Intel)" >> release_notes.md + echo '```bash' >> release_notes.md + echo "tar -xzf _${VERSION}_darwin_amd64.tar.gz" >> release_notes.md + echo '```' >> release_notes.md + echo "" >> release_notes.md + echo "### macOS (Apple Silicon)" >> release_notes.md + echo '```bash' >> release_notes.md + echo "tar -xzf _${VERSION}_darwin_arm64.tar.gz" >> release_notes.md + echo '```' >> release_notes.md + echo "" >> release_notes.md + echo "### Windows (AMD64)" >> release_notes.md + echo '```powershell' >> release_notes.md + echo "Expand-Archive _${VERSION}_windows_amd64.zip" >> release_notes.md + echo '```' >> release_notes.md + echo "" >> release_notes.md + echo "Available tools: Replace \`\` with one of the obitools commands." >> release_notes.md + + - name: Create GitHub Release + uses: softprops/action-gh-release@v1 + with: + name: Release ${{ steps.get_version.outputs.version }} + body_path: release_notes.md + files: release/* + draft: false + prerelease: false + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/Makefile b/Makefile index ee8ec71..2d879d2 100644 --- a/Makefile +++ b/Makefile @@ -137,10 +137,11 @@ jjpush: @echo "$(BLUE)→ Documenting version bump commit...$(NC)" @jj auto-describe @version=$$(cat version.txt); \ - echo "$(BLUE)→ Pushing commits and creating tag v$$version...$(NC)"; \ + tag_name="Release_$$version"; \ + echo "$(BLUE)→ Pushing commits and creating tag $$tag_name...$(NC)"; \ jj git push --change @; \ - git tag -a "v$$version" -m "Release $$version" 2>/dev/null || echo "Tag v$$version already exists"; \ - git push origin "v$$version" 2>/dev/null || echo "Tag already pushed" + git tag -a "$$tag_name" -m "Release $$version" 2>/dev/null || echo "Tag $$tag_name already exists"; \ + git push origin "$$tag_name" 2>/dev/null || echo "Tag already pushed" @echo "$(GREEN)✓ Commits and tag pushed to repository$(NC)" jjfetch: From 23f145a4c2e55cdbc995efcd27f1d835749cac00 Mon Sep 17 00:00:00 2001 From: Eric Coissac Date: Thu, 5 Feb 2026 17:53:52 +0100 Subject: [PATCH 2/2] Bump version to 4.4.5 Update version number from 4.4.4 to 4.4.5 in both version.go and version.txt files. --- pkg/obioptions/version.go | 2 +- version.txt | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) 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