Add Gitea Actions workflow for build and release
All checks were successful
Build and Release / build (push) Successful in 48s
Build and Release / release (amd64, amd64, darwin, darwin) (push) Has been skipped
Build and Release / release (amd64, amd64, linux, linux) (push) Has been skipped
Build and Release / release (amd64, amd64, windows, windows) (push) Has been skipped
Build and Release / release (arm64, arm64, darwin, darwin) (push) Has been skipped
Build and Release / release (arm64, arm64, linux, linux) (push) Has been skipped
All checks were successful
Build and Release / build (push) Successful in 48s
Build and Release / release (amd64, amd64, darwin, darwin) (push) Has been skipped
Build and Release / release (amd64, amd64, linux, linux) (push) Has been skipped
Build and Release / release (amd64, amd64, windows, windows) (push) Has been skipped
Build and Release / release (arm64, arm64, darwin, darwin) (push) Has been skipped
Build and Release / release (arm64, arm64, linux, linux) (push) Has been skipped
- Build and test on push to main and PRs - Create multi-platform releases on version tags - Supports Linux, macOS, and Windows (amd64 and arm64) Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
83
.gitea/workflows/build.yml
Normal file
83
.gitea/workflows/build.yml
Normal file
@@ -0,0 +1,83 @@
|
||||
name: Build and Release
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- main
|
||||
tags:
|
||||
- 'v*'
|
||||
pull_request:
|
||||
branches:
|
||||
- main
|
||||
|
||||
jobs:
|
||||
build:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@v3
|
||||
|
||||
- name: Set up Go
|
||||
uses: actions/setup-go@v4
|
||||
with:
|
||||
go-version: '1.19'
|
||||
|
||||
- name: Build
|
||||
run: go build -v ./...
|
||||
|
||||
- name: Test
|
||||
run: go test -v ./...
|
||||
|
||||
release:
|
||||
runs-on: ubuntu-latest
|
||||
needs: build
|
||||
if: startsWith(github.ref, 'refs/tags/v')
|
||||
strategy:
|
||||
matrix:
|
||||
include:
|
||||
- os: linux
|
||||
arch: amd64
|
||||
goos: linux
|
||||
goarch: amd64
|
||||
- os: linux
|
||||
arch: arm64
|
||||
goos: linux
|
||||
goarch: arm64
|
||||
- os: darwin
|
||||
arch: amd64
|
||||
goos: darwin
|
||||
goarch: amd64
|
||||
- os: darwin
|
||||
arch: arm64
|
||||
goos: darwin
|
||||
goarch: arm64
|
||||
- os: windows
|
||||
arch: amd64
|
||||
goos: windows
|
||||
goarch: amd64
|
||||
steps:
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@v3
|
||||
|
||||
- name: Set up Go
|
||||
uses: actions/setup-go@v4
|
||||
with:
|
||||
go-version: '1.19'
|
||||
|
||||
- name: Build binary
|
||||
env:
|
||||
GOOS: ${{ matrix.goos }}
|
||||
GOARCH: ${{ matrix.goarch }}
|
||||
CGO_ENABLED: 0
|
||||
run: |
|
||||
if [ "${{ matrix.os }}" = "windows" ]; then
|
||||
go build -o unhttpx-${{ matrix.os }}-${{ matrix.arch }}.exe -ldflags="-s -w" .
|
||||
else
|
||||
go build -o unhttpx-${{ matrix.os }}-${{ matrix.arch }} -ldflags="-s -w" .
|
||||
fi
|
||||
|
||||
- name: Create Release
|
||||
uses: actions/gitea-release-action@v1
|
||||
with:
|
||||
files: unhttpx-*
|
||||
token: ${{ secrets.GITHUB_TOKEN }}
|
||||
Reference in New Issue
Block a user