Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
54 changes: 37 additions & 17 deletions .github/workflows/build-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ name: Build and Release

on:
push:
branches:
- main
tags:
- 'v*.*.*'

jobs:
test:
Expand Down Expand Up @@ -212,7 +212,7 @@ jobs:
name: Create Release
needs: build
runs-on: ubuntu-latest
if: github.ref == 'refs/heads/main'
if: startsWith(github.ref, 'refs/tags/')

steps:
- name: Checkout code
Expand All @@ -223,28 +223,48 @@ jobs:
with:
path: artifacts

- name: Get tag name
id: tag
run: echo "tag=${GITHUB_REF#refs/tags/}" >> $GITHUB_OUTPUT

- name: Rename binaries with proper names
run: |
mv artifacts/safepaw-linux-x86_64/safepaw artifacts/safepaw-linux-x86_64/safepaw-linux-x86_64
mv artifacts/safepaw-linux-aarch64/safepaw artifacts/safepaw-linux-aarch64/safepaw-linux-aarch64
mv artifacts/safepaw-macos-x86_64/safepaw artifacts/safepaw-macos-x86_64/safepaw-macos-x86_64
mv artifacts/safepaw-macos-aarch64/safepaw artifacts/safepaw-macos-aarch64/safepaw-macos-aarch64
mv artifacts/safepaw-windows-x86_64/safepaw.exe artifacts/safepaw-windows-x86_64/safepaw-windows-x86_64.exe

- name: Create GitHub Release
uses: softprops/action-gh-release@v2
with:
tag_name: build-${{ github.run_number }}
name: Build ${{ github.run_number }}
tag_name: ${{ steps.tag.outputs.tag }}
name: Release ${{ steps.tag.outputs.tag }}
body: |
Automated build from commit ${{ github.sha }}
Release ${{ steps.tag.outputs.tag }}

**Changes:** ${{ github.event.head_commit.message }}
**Commit:** ${{ github.sha }}

## Binaries
- Linux x86_64
- Linux ARM64
- macOS x86_64 (Intel)
- macOS ARM64 (Apple Silicon)
- Windows x86_64

### Linux (glibc-based distributions: Ubuntu, Debian, Fedora, etc.)
- `safepaw-linux-x86_64` - Linux x86_64 (64-bit Intel/AMD)
- `safepaw-linux-aarch64` - Linux ARM64 (64-bit ARM)

### macOS
- `safepaw-macos-x86_64` - macOS Intel (x86_64)
- `safepaw-macos-aarch64` - macOS Apple Silicon (ARM64)

### Windows
- `safepaw-windows-x86_64.exe` - Windows x86_64 (64-bit)

**Note:** Linux binaries are dynamically linked against glibc and may not work on musl-based distributions (Alpine Linux). If you need musl support, please build from source.
files: |
artifacts/safepaw-linux-x86_64/safepaw
artifacts/safepaw-linux-aarch64/safepaw
artifacts/safepaw-macos-x86_64/safepaw
artifacts/safepaw-macos-aarch64/safepaw
artifacts/safepaw-windows-x86_64/safepaw.exe
artifacts/safepaw-linux-x86_64/safepaw-linux-x86_64
artifacts/safepaw-linux-aarch64/safepaw-linux-aarch64
artifacts/safepaw-macos-x86_64/safepaw-macos-x86_64
artifacts/safepaw-macos-aarch64/safepaw-macos-aarch64
artifacts/safepaw-windows-x86_64/safepaw-windows-x86_64.exe
draft: false
prerelease: false
env:
Expand Down
10 changes: 3 additions & 7 deletions .github/workflows/tagging.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,17 +20,13 @@ jobs:
with:
github_token: ${{ secrets.GITHUB_TOKEN }}

- name: Set Cargo.toml version to match github tag for docs
- name: Set Cargo.toml version to match github tag
shell: bash
env:
RELEASE_TAG: ${{ steps.tag_version.outputs.new_tag }}
run: |
mv docs/python/src/conf.py docs/python/src/conf.py.orig
sed "s/0\\.0\\.0/${RELEASE_TAG//v}/" docs/python/src/conf.py.orig >docs/python/src/conf.py
rm docs/python/src/conf.py.orig
mv docs/python/requirements-docs.txt docs/python/requirements-docs.txt.orig
sed "s/0\\.0\\.0/${RELEASE_TAG//v}/" docs/python/requirements-docs.txt.orig >docs/python/requirements-docs.txt
rm docs/python/requirements-docs.txt.orig
VERSION=${RELEASE_TAG#v}
sed -i 's/^version = ".*"/version = "'"$VERSION"'"/' Cargo.toml

- name: Commit files and create tag
env:
Expand Down