update ci

This commit is contained in:
2026-08-15 02:14:26 +05:00
parent aeb59e8eda
commit 226b1e1b42
8 changed files with 163 additions and 84 deletions
+13 -76
View File
@@ -1,32 +1,15 @@
name: Build self-hosted HTTP Toolkit
name: Build & Release binary
on:
push:
branches: [main]
tags: ['v*']
pull_request:
tags:
- 'v*'
workflow_dispatch:
permissions:
contents: write # needed to publish releases on tags
jobs:
build:
strategy:
fail-fast: false
matrix:
include:
- os: ubuntu-latest
name: linux-x64
smoke: true
- os: macos-latest # Apple Silicon runner (arm64)
name: macos-arm64
smoke: true
- os: windows-latest
name: windows-x64
smoke: false # background-process smoke is unix-only; --help still runs
runs-on: docker-compose
runs-on: ${{ matrix.os }}
steps:
- name: Checkout (with submodules)
uses: actions/checkout@v4
@@ -34,60 +17,14 @@ jobs:
submodules: recursive
fetch-depth: 0
- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: 22
- name: Build Linux binary (docker)
working-directory: .build/prod
run: docker compose run --rm prod
- name: Setup Bun
uses: oven-sh/setup-bun@v2
with:
bun-version: latest
- name: Build
shell: bash
- name: Create Gitea release & upload assets
if: startsWith(gitea.ref, 'refs/tags/')
env:
OUT_NAME: httptoolkit
run: bash scripts/build.sh
- name: Smoke test (unix)
if: matrix.smoke
shell: bash
run: bash scripts/smoke.sh dist/httptoolkit
- name: Windows sanity (--help)
if: matrix.os == 'windows-latest'
shell: bash
run: ./dist/httptoolkit.exe --help
- name: Stage artifact
shell: bash
run: |
mkdir -p out
if [ "${{ matrix.os }}" = "windows-latest" ]; then
cp dist/httptoolkit.exe "out/httptoolkit-${{ matrix.name }}.exe"
else
cp dist/httptoolkit "out/httptoolkit-${{ matrix.name }}"
fi
- name: Upload build artifact
uses: actions/upload-artifact@v4
with:
name: httptoolkit-${{ matrix.name }}
path: out/*
release:
# Publish a GitHub release only when a v* tag is pushed.
if: startsWith(github.ref, 'refs/tags/v')
needs: build
runs-on: ubuntu-latest
steps:
- name: Download all artifacts
uses: actions/download-artifact@v4
with:
path: artifacts
- name: Publish release
uses: softprops/action-gh-release@v2
with:
files: artifacts/**/*
generate_release_notes: true
GITEA_SERVER_URL: ${{ gitea.server_url }}
GITEA_REPOSITORY: ${{ gitea.repository }}
GITEA_TOKEN: ${{ secrets.PAT_GITEA }}
run: bash .build/prod/release.sh "${{ gitea.ref_name }}"