From a648dc5fd7803ec19db1c83ae1a9524f4e63a505 Mon Sep 17 00:00:00 2001 From: Jeremie Fraeys Date: Tue, 10 Feb 2026 18:13:25 -0500 Subject: [PATCH] Move manwhere release workflow to submodule --- .github/workflows/release.yml | 96 ----------------------------------- scripts/manwhere | 2 +- 2 files changed, 1 insertion(+), 97 deletions(-) delete mode 100644 .github/workflows/release.yml diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml deleted file mode 100644 index 0aef91b..0000000 --- a/.github/workflows/release.yml +++ /dev/null @@ -1,96 +0,0 @@ ---- -name: Create Release -on: - push: - branches: - - main - paths: - - 'manwhere' - - '.github/workflows/release.yml' - -jobs: - release: - runs-on: self-hosted - steps: - - name: Checkout repository - uses: actions/checkout@v4 - - - name: Setup Zig - run: | - if ! command -v zig &> /dev/null; then - ZIG_VERSION=$(curl -s "https://api.github.com/repos/ziglang/zig/releases/latest" | grep -Po '"tag_name": "\K[0-9.]+') - wget -qO zig.tar.xz https://ziglang.org/download/${ZIG_VERSION}/zig-x86_64-linux-${ZIG_VERSION}.tar.xz - sudo mkdir -p /opt/zig - sudo tar xf zig.tar.xz --strip-components=1 -C /opt/zig - sudo ln -s /opt/zig/zig /usr/local/bin/zig - rm -f zig.tar.xz - fi - zig version - - - name: Run tests - run: | - cd scripts/manwhere && zig build test - - - name: Get version from commit - id: version - run: | - VERSION=$(git describe --tags --always --dirty 2>/dev/null || echo "v0.1.0-$(git rev-parse --short HEAD)") - echo "version=$VERSION" >> $GITHUB_OUTPUT - echo "Version: $VERSION" - - - name: Check if version changed - id: check_version - env: - GITEA_TOKEN: ${{ secrets.GITEA_TOKEN }} - run: | - VERSION="${{ steps.version.outputs.version }}" - - # Get latest release tag - LATEST_RELEASE=$(curl -s -H "Authorization: token $GITEA_TOKEN" \ - "${{ github.server_url }}/api/v1/repos/${{ github.repository }}/releases/latest" | jq -r '.tag_name // empty') - - echo "Latest release: $LATEST_RELEASE" - echo "Current version: $VERSION" - - if [ "$LATEST_RELEASE" = "$VERSION" ]; then - echo "Version unchanged, skipping release" - echo "changed=false" >> $GITHUB_OUTPUT - else - echo "Version changed, creating release" - echo "changed=true" >> $GITHUB_OUTPUT - fi - - - name: Create Release - if: steps.check_version.outputs.changed == 'true' - env: - GITEA_TOKEN: ${{ secrets.GITEA_TOKEN }} - run: | - VERSION="${{ steps.version.outputs.version }}" - - # Delete existing release with same tag if exists - curl -s -X DELETE \ - -H "Authorization: token $GITEA_TOKEN" \ - "${{ github.server_url }}/api/v1/repos/${{ github.repository }}/releases/tags/$VERSION" || true - - # Create new release - curl -s -X POST \ - -H "Authorization: token $GITEA_TOKEN" \ - -H "Content-Type: application/json" \ - -d "{ - \"tag_name\": \"$VERSION\", - \"name\": \"manwhere $VERSION\", - \"body\": \"Release of manwhere binary\\n\\nBuilt from commit: ${{ github.sha }}\", - \"target_commitish\": \"main\" - }" \ - "${{ github.server_url }}/api/v1/repos/${{ github.repository }}/releases" | tee release.json - - RELEASE_ID=$(jq -r '.id' release.json) - - # Upload binary - curl -s -X POST \ - -H "Authorization: token $GITEA_TOKEN" \ - -H "Content-Type: application/octet-stream" \ - --data-binary @manwhere \ - "${{ github.server_url }}/api/v1/repos/${{ github.repository }}/releases/$RELEASE_ID/assets?name=manwhere&attachment=true" - - echo "Release created: ${{ github.server_url }}/${{ github.repository }}/releases/tag/$VERSION" diff --git a/scripts/manwhere b/scripts/manwhere index 26eb50d..1d113ea 160000 --- a/scripts/manwhere +++ b/scripts/manwhere @@ -1 +1 @@ -Subproject commit 26eb50d38f31ad0f791242e84481f57c4d2326e9 +Subproject commit 1d113eacf7be30e7b2b4d0f39c312fbcd45c16bd