From 60a9e99425b3cfe12cf9e4fdfd74430c638e16e0 Mon Sep 17 00:00:00 2001 From: Bruce Hill Date: Sun, 21 Dec 2025 14:22:56 -0500 Subject: Add github workflow --- .github/workflows/release.yml | 105 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 105 insertions(+) create mode 100644 .github/workflows/release.yml (limited to '.github') diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 00000000..234d0685 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,105 @@ +name: Release binaries + +on: + [push] + +jobs: + linux-x86_64: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + + - name: Install deps + run: | + sudo apt-get update + sudo apt-get install -y \ + build-essential \ + libgmp-dev \ + libunistring-dev \ + libgc-dev \ + xxd \ + binutils + + - name: Build + run: | + make clean + make + + - name: Package + run: | + mkdir -p tomo + cp tomo tomo/tomo + tar -czf tomo-linux-x86_64.tar.gz tomo + sha256sum tomo-linux-x86_64.tar.gz > tomo-linux-x86_64.tar.gz.sha256 + + - name: Upload + uses: softprops/action-gh-release@v2 + with: + files: | + tomo-linux-x86_64.tar.gz + tomo-linux-x86_64.tar.gz.sha256 + + linux-aarch64: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + + - name: Install deps + run: | + sudo apt-get update + sudo apt-get install -y \ + build-essential \ + libgmp-dev \ + libunistring-dev \ + libgc-dev \ + xxd \ + binutils + + - name: Build + run: | + make clean + make + + - name: Package + run: | + mkdir -p tomo + cp tomo tomo/tomo + tar -czf tomo-linux-aarch64.tar.gz tomo + sha256sum tomo-linux-aarch64.tar.gz > tomo-linux-aarch64.tar.gz.sha256 + + - name: Upload + uses: softprops/action-gh-release@v2 + with: + files: | + tomo-linux-aarch64.tar.gz + tomo-linux-aarch64.tar.gz.sha256 + + macos: + runs-on: macos-latest + steps: + - uses: actions/checkout@v4 + + - name: Install deps + run: | + brew update + brew install gmp libunistring bdw-gc xxd llvm binutils + + - name: Build + run: | + make clean + make + + - name: Package + run: | + mkdir -p tomo + cp tomo tomo/tomo + tar -czf tomo-macos-universal.tar.gz tomo + shasum -a 256 tomo-macos-universal.tar.gz > tomo-macos-universal.tar.gz.sha256 + + - name: Upload + uses: softprops/action-gh-release@v2 + with: + files: | + tomo-macos-universal.tar.gz + tomo-macos-universal.tar.gz.sha256 + -- cgit v1.2.3 From 1fe355e1e14f099c594573db709555429464b204 Mon Sep 17 00:00:00 2001 From: Bruce Hill Date: Sun, 21 Dec 2025 14:23:10 -0500 Subject: Only build on tag pushing --- .github/workflows/release.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to '.github') diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 234d0685..45b02e08 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -1,7 +1,9 @@ name: Release binaries on: - [push] + push: + tags: + - 'v*' jobs: linux-x86_64: -- cgit v1.2.3 From 1836d095f88ff83d9499c1e979362352a1fa400b Mon Sep 17 00:00:00 2001 From: Bruce Hill Date: Sun, 21 Dec 2025 14:27:16 -0500 Subject: Minor fix for checking return values --- .github/workflows/release.yml | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to '.github') diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 45b02e08..234d0685 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -1,9 +1,7 @@ name: Release binaries on: - push: - tags: - - 'v*' + [push] jobs: linux-x86_64: -- cgit v1.2.3 From 86a08a38a8a60b6a0de0da62a5d3fa843f6db71f Mon Sep 17 00:00:00 2001 From: Bruce Hill Date: Sun, 21 Dec 2025 14:30:11 -0500 Subject: Fix empty allocation --- .github/workflows/release.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to '.github') diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 234d0685..d153774f 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -23,7 +23,7 @@ jobs: - name: Build run: | make clean - make + make -j - name: Package run: | @@ -58,7 +58,7 @@ jobs: - name: Build run: | make clean - make + make -j - name: Package run: | @@ -87,7 +87,7 @@ jobs: - name: Build run: | make clean - make + make -j - name: Package run: | -- cgit v1.2.3 From bd244c69f5edd6b84753a4bc6c2bd1ca011e90f7 Mon Sep 17 00:00:00 2001 From: Bruce Hill Date: Sun, 21 Dec 2025 16:02:08 -0500 Subject: Tweak build setup --- .github/workflows/release.yml | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) (limited to '.github') diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index d153774f..57bfc0e7 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -27,9 +27,7 @@ jobs: - name: Package run: | - mkdir -p tomo - cp tomo tomo/tomo - tar -czf tomo-linux-x86_64.tar.gz tomo + tar -czf tomo-linux-x86_64.tar.gz build/* sha256sum tomo-linux-x86_64.tar.gz > tomo-linux-x86_64.tar.gz.sha256 - name: Upload @@ -62,9 +60,7 @@ jobs: - name: Package run: | - mkdir -p tomo - cp tomo tomo/tomo - tar -czf tomo-linux-aarch64.tar.gz tomo + tar -czf tomo-linux-aarch64.tar.gz build/* sha256sum tomo-linux-aarch64.tar.gz > tomo-linux-aarch64.tar.gz.sha256 - name: Upload @@ -91,9 +87,7 @@ jobs: - name: Package run: | - mkdir -p tomo - cp tomo tomo/tomo - tar -czf tomo-macos-universal.tar.gz tomo + tar -czf tomo-macos-universal.tar.gz build/* shasum -a 256 tomo-macos-universal.tar.gz > tomo-macos-universal.tar.gz.sha256 - name: Upload -- cgit v1.2.3 From e9ec2558b7493064d0c353007b79791e3946eb4a Mon Sep 17 00:00:00 2001 From: Bruce Hill Date: Sun, 21 Dec 2025 16:03:30 -0500 Subject: Put workflow back --- .github/workflows/release.yml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to '.github') diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 57bfc0e7..e9fa03a7 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -1,7 +1,9 @@ name: Release binaries on: - [push] + push: + tags: + - 'v*' jobs: linux-x86_64: @@ -78,7 +80,7 @@ jobs: - name: Install deps run: | brew update - brew install gmp libunistring bdw-gc xxd llvm binutils + brew install gmp libunistring bdw-gc llvm binutils - name: Build run: | -- cgit v1.2.3 From 07cc08924a9a15b4f743a68e0eabf8337b0b446a Mon Sep 17 00:00:00 2001 From: Bruce Hill Date: Sun, 21 Dec 2025 16:11:46 -0500 Subject: Add workflow permissions --- .github/workflows/release.yml | 3 +++ 1 file changed, 3 insertions(+) (limited to '.github') diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index e9fa03a7..80d5bb67 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -99,3 +99,6 @@ jobs: tomo-macos-universal.tar.gz tomo-macos-universal.tar.gz.sha256 +permissions: + contents: write + packages: write -- cgit v1.2.3 From 7b3a651da64e3e1951ab01e5650c5ceaa1dd5d84 Mon Sep 17 00:00:00 2001 From: Bruce Hill Date: Sun, 21 Dec 2025 17:04:08 -0500 Subject: Remove xxd dependency (no more building with changelog) --- .github/workflows/release.yml | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to '.github') diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 80d5bb67..cdbf541d 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -29,7 +29,8 @@ jobs: - name: Package run: | - tar -czf tomo-linux-x86_64.tar.gz build/* + TAG=${GITHUB_REF#refs/tags/} + tar -C build -czf tomo-linux-x86_64.tar.gz tomo@${TAG} sha256sum tomo-linux-x86_64.tar.gz > tomo-linux-x86_64.tar.gz.sha256 - name: Upload @@ -62,7 +63,8 @@ jobs: - name: Package run: | - tar -czf tomo-linux-aarch64.tar.gz build/* + TAG=${GITHUB_REF#refs/tags/} + tar -C build -czf tomo-linux-aarch64.tar.gz tomo@{TAG} sha256sum tomo-linux-aarch64.tar.gz > tomo-linux-aarch64.tar.gz.sha256 - name: Upload @@ -89,7 +91,8 @@ jobs: - name: Package run: | - tar -czf tomo-macos-universal.tar.gz build/* + TAG=${GITHUB_REF#refs/tags/} + tar -C build -czf tomo-macos-universal.tar.gz tomo@${TAG} shasum -a 256 tomo-macos-universal.tar.gz > tomo-macos-universal.tar.gz.sha256 - name: Upload -- cgit v1.2.3 From 0a5fc171c54bdedce0dad34701562831a497fccc Mon Sep 17 00:00:00 2001 From: Bruce Hill Date: Sun, 21 Dec 2025 17:08:59 -0500 Subject: Fix workflow --- .github/workflows/release.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to '.github') diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index cdbf541d..1d6c5dba 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -64,7 +64,7 @@ jobs: - name: Package run: | TAG=${GITHUB_REF#refs/tags/} - tar -C build -czf tomo-linux-aarch64.tar.gz tomo@{TAG} + tar -C build -czf tomo-linux-aarch64.tar.gz tomo@${TAG} sha256sum tomo-linux-aarch64.tar.gz > tomo-linux-aarch64.tar.gz.sha256 - name: Upload -- cgit v1.2.3 From 0ee53cd5a79d41b124413d5da3e4279d06b17bfc Mon Sep 17 00:00:00 2001 From: Bruce Hill Date: Mon, 22 Dec 2025 14:34:42 -0500 Subject: Attempted improvements for building on mac --- .github/workflows/release.yml | 32 +++++++++++++++++++++++++++----- 1 file changed, 27 insertions(+), 5 deletions(-) (limited to '.github') diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 1d6c5dba..2be7084e 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -5,6 +5,10 @@ on: tags: - 'v*' +permissions: + contents: write + packages: write + jobs: linux-x86_64: runs-on: ubuntu-latest @@ -84,10 +88,31 @@ jobs: brew update brew install gmp libunistring bdw-gc llvm binutils - - name: Build + - name: Build arm64 run: | make clean - make -j + make -j \ + CC=clang \ + CFLAGS="-arch arm64" \ + LDFLAGS="-arch arm64" + mv build/tomo build/tomo-arm64 + + - name: Build x86_64 + run: | + make clean + make -j \ + CC=clang \ + CFLAGS="-arch x86_64" \ + LDFLAGS="-arch x86_64" + mv build/tomo build/tomo-x86_64 + + - name: Create universal binary + run: | + lipo -create \ + build/tomo-arm64 \ + build/tomo-x86_64 \ + -output build/tomo + lipo -info build/tomo - name: Package run: | @@ -102,6 +127,3 @@ jobs: tomo-macos-universal.tar.gz tomo-macos-universal.tar.gz.sha256 -permissions: - contents: write - packages: write -- cgit v1.2.3 From 1a62de25c448d2661864ba25a98686ed506e66af Mon Sep 17 00:00:00 2001 From: Bruce Hill Date: Tue, 23 Dec 2025 15:28:05 -0500 Subject: Overhaul workflow to add automatic pushing to AUR and fix up mac builds --- .github/workflows/release.yml | 171 +++++++++++++++++++++++------------------- 1 file changed, 95 insertions(+), 76 deletions(-) (limited to '.github') diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 2be7084e..0e4f08d0 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -7,123 +7,142 @@ on: permissions: contents: write - packages: write + +env: + PKGNAME: tomo jobs: - linux-x86_64: - runs-on: ubuntu-latest + build-linux: + strategy: + matrix: + arch: + - x86_64 + - aarch64 + + include: + - arch: x86_64 + runner: ubuntu-latest + - arch: aarch64 + runner: ubuntu-24.04-arm64 + + runs-on: ${{ matrix.runner }} + steps: - uses: actions/checkout@v4 - name: Install deps run: | sudo apt-get update - sudo apt-get install -y \ - build-essential \ - libgmp-dev \ - libunistring-dev \ - libgc-dev \ - xxd \ - binutils + sudo apt-get install -y build-essential libgmp-dev libunistring-dev libgc-dev binutils - name: Build run: | - make clean make -j - name: Package run: | - TAG=${GITHUB_REF#refs/tags/} - tar -C build -czf tomo-linux-x86_64.tar.gz tomo@${TAG} - sha256sum tomo-linux-x86_64.tar.gz > tomo-linux-x86_64.tar.gz.sha256 + TAG=${GITHUB_REF_NAME} + FILE=${PKGNAME}-linux-${{ matrix.arch }}.tar.gz + tar -C build -czf "$FILE" ${PKGNAME}@${TAG} + sha256sum "$FILE" > "$FILE.sha256" - - name: Upload - uses: softprops/action-gh-release@v2 + - name: Upload artifacts + uses: actions/upload-artifact@v3 with: - files: | - tomo-linux-x86_64.tar.gz - tomo-linux-x86_64.tar.gz.sha256 + name: linux-${{ matrix.arch }} + path: | + ${PKGNAME}-linux-${{ matrix.arch }}.tar.gz + ${PKGNAME}-linux-${{ matrix.arch }}.tar.gz.sha256 - linux-aarch64: - runs-on: ubuntu-latest + build-macos: + runs-on: macos-latest steps: - uses: actions/checkout@v4 - name: Install deps run: | - sudo apt-get update - sudo apt-get install -y \ - build-essential \ - libgmp-dev \ - libunistring-dev \ - libgc-dev \ - xxd \ - binutils + brew update + brew install gmp libunistring bdw-gc llvm binutils - - name: Build + - name: Build arm64 run: | - make clean make -j - name: Package run: | - TAG=${GITHUB_REF#refs/tags/} - tar -C build -czf tomo-linux-aarch64.tar.gz tomo@${TAG} - sha256sum tomo-linux-aarch64.tar.gz > tomo-linux-aarch64.tar.gz.sha256 + TAG=${GITHUB_REF_NAME} + tar -C build -czf ${PKGNAME}-macos-arm64.tar.gz ${PKGNAME}@${TAG} + shasum -a 256 ${PKGNAME}-macos-arm64.tar.gz > ${PKGNAME}-macos-arm64.tar.gz.sha256 - - name: Upload + - name: Upload artifacts + uses: actions/upload-artifact@v3 + with: + name: macos-arm64 + path: | + ${PKGNAME}-macos-arm64.tar.gz + ${PKGNAME}-macos-arm64.tar.gz.sha256 + + upload-release: + needs: [build-linux, build-macos] + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + + - name: Download all artifacts + uses: actions/download-artifact@v3 + with: + path: release/ + + - name: List artifacts + run: ls -l release/ + + - name: Create GitHub Release uses: softprops/action-gh-release@v2 with: - files: | - tomo-linux-aarch64.tar.gz - tomo-linux-aarch64.tar.gz.sha256 + files: release/* - macos: - runs-on: macos-latest + aur: + needs: upload-release + runs-on: ubuntu-latest + env: + AUR_SSH_KEY: ${{ secrets.AUR_SSH_KEY }} steps: - uses: actions/checkout@v4 - name: Install deps run: | - brew update - brew install gmp libunistring bdw-gc llvm binutils + sudo apt-get install -y pacman-contrib jq gh - - name: Build arm64 + - name: Set up SSH run: | - make clean - make -j \ - CC=clang \ - CFLAGS="-arch arm64" \ - LDFLAGS="-arch arm64" - mv build/tomo build/tomo-arm64 - - - name: Build x86_64 + mkdir -p ~/.ssh + echo "$AUR_SSH_KEY" > ~/.ssh/id_ed25519 + chmod 600 ~/.ssh/id_ed25519 + ssh-keyscan aur.archlinux.org >> ~/.ssh/known_hosts + + - name: Wait for release assets run: | - make clean - make -j \ - CC=clang \ - CFLAGS="-arch x86_64" \ - LDFLAGS="-arch x86_64" - mv build/tomo build/tomo-x86_64 - - - name: Create universal binary + TAG=${GITHUB_REF_NAME} + for i in $(seq 60); do + if gh release view "$TAG" --json assets \ + | jq -e '[ .assets[].name ] | index("tomo-linux-x86_64.tar.gz") and index("tomo-linux-aarch64.tar.gz")' >/dev/null + then exit 0; fi + sleep 10 + done + echo "Timed out waiting for release assets" + exit 1 + + - name: Update PKGBUILD run: | - lipo -create \ - build/tomo-arm64 \ - build/tomo-x86_64 \ - -output build/tomo - lipo -info build/tomo - - - name: Package + TAG=${GITHUB_REF_NAME#v} + sed -i "s/^_tomo_version=.*/_tomo_version=${TAG}/" PKGBUILD + updpkgsums + makepkg --printsrcinfo > .SRCINFO + git config user.name "GitHub Actions" + git config user.email "actions@github.com" + git diff --quiet || git commit -am "Release v${TAG}" + + - name: Push to AUR run: | - TAG=${GITHUB_REF#refs/tags/} - tar -C build -czf tomo-macos-universal.tar.gz tomo@${TAG} - shasum -a 256 tomo-macos-universal.tar.gz > tomo-macos-universal.tar.gz.sha256 - - - name: Upload - uses: softprops/action-gh-release@v2 - with: - files: | - tomo-macos-universal.tar.gz - tomo-macos-universal.tar.gz.sha256 + git push aur HEAD:master -- cgit v1.2.3