Skip to content
50 changes: 50 additions & 0 deletions .github/workflows/auto-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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: |
<p align="center">
<img alt="golangci-lint logo" src="https://avatars.githubusercontent.com/u/252895549?s=400&u=6c747c431c2844620af7772fcd716ef423a6ab1d&v=4" height="150" />
<h3 align="center">netcorelink/libchttpx</h3>
<p align="center">A powerful, cross-platform HTTP server library in C/C++ for building full-featured web servers</p>
</p>

---

> :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
```
23 changes: 19 additions & 4 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,30 +1,45 @@
# 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:
runs-on: ubuntu-latest
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: |
<p align="center">
Expand Down
Loading