diff --git a/.github/workflows/auto-release.yml b/.github/workflows/auto-release.yml index 2f0281e..380e3a0 100644 --- a/.github/workflows/auto-release.yml +++ b/.github/workflows/auto-release.yml @@ -14,6 +14,9 @@ concurrency: jobs: tag: runs-on: ubuntu-latest + outputs: + changed: ${{ steps.version.outputs.changed }} + version_tag: ${{ steps.version.outputs.version_tag }} steps: - name: Checkout uses: actions/checkout@v4 @@ -38,3 +41,50 @@ jobs: git config user.email "github-actions[bot]@users.noreply.github.com" git tag "${{ steps.version.outputs.version_tag }}" git push origin "${{ steps.version.outputs.version_tag }}" + + release: + needs: tag + if: needs.tag.outputs.changed == 'true' + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v4 + with: + ref: ${{ needs.tag.outputs.version_tag }} + + - name: Install dependencies + run: | + sudo apt update + sudo apt install -y gcc make libcjson-dev + + - name: Build release archive + run: make lin-lib + + - name: Create GitHub Release + uses: softprops/action-gh-release@v2 + with: + tag_name: ${{ needs.tag.outputs.version_tag }} + name: libchttpx ${{ needs.tag.outputs.version_tag }} + files: libchttpx-dev.tar.gz + body: | +

+ golangci-lint logo +

netcorelink/libchttpx

+

A powerful, cross-platform HTTP server library in C/C++ for building full-featured web servers

+

+ + --- + + > :warning: **Warning:** Use the `linux environment` for stable library operation. + + ## Linux + + ```bash + curl -s https://raw.githubusercontent.com/netcorelink/libchttpx/main/scripts/install.sh | sudo sh + ``` + + ## Windows + + ```powershell + iwr https://raw.githubusercontent.com/netcorelink/libchttpx/main/scripts/install.ps1 -UseBasicParsing | iex + ``` diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 1255dda..9b0b336 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -1,9 +1,22 @@ +# Runs when a tag is pushed manually (local: git push origin v1.5.6). +# Tags created by Auto Release Tag do NOT trigger this workflow (GitHub limitation). +# Use "Run workflow" below to publish an existing tag without re-pushing it. + name: Release on: push: tags: - "v*" + workflow_dispatch: + inputs: + tag: + description: "Existing tag to publish (e.g. v1.5.6)" + required: true + type: string + +permissions: + contents: write jobs: release: @@ -11,20 +24,22 @@ jobs: steps: - name: Checkout uses: actions/checkout@v4 + with: + ref: ${{ github.event.inputs.tag || github.ref }} - name: Install dependencies run: | sudo apt update - sudo apt install -y gcc make libcjson-dev clang-format + sudo apt install -y gcc make libcjson-dev - name: Build release archive - run: | - make lin-lib + run: make lin-lib - name: Create Release uses: softprops/action-gh-release@v2 with: - name: libchttpx ${{ github.ref_name }} + tag_name: ${{ github.event.inputs.tag || github.ref_name }} + name: libchttpx ${{ github.event.inputs.tag || github.ref_name }} files: libchttpx-dev.tar.gz body: |