mirror of
https://github.com/YuzuZensai/Git-Identity-Audit.git
synced 2026-09-13 18:59:04 +00:00
✨ feat: Initial commit
This commit is contained in:
@@ -0,0 +1,70 @@
|
||||
name: CI
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [main]
|
||||
tags: ["v*.*.*"]
|
||||
pull_request:
|
||||
|
||||
jobs:
|
||||
test:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v5
|
||||
- uses: actions/setup-go@v6
|
||||
with:
|
||||
go-version: "1.26.4"
|
||||
- run: go build ./...
|
||||
- run: go vet ./...
|
||||
- run: go test ./...
|
||||
|
||||
build:
|
||||
needs: test
|
||||
runs-on: ubuntu-latest
|
||||
strategy:
|
||||
matrix:
|
||||
include:
|
||||
- goos: linux
|
||||
goarch: amd64
|
||||
- goos: linux
|
||||
goarch: arm64
|
||||
- goos: darwin
|
||||
goarch: amd64
|
||||
- goos: darwin
|
||||
goarch: arm64
|
||||
- goos: windows
|
||||
goarch: amd64
|
||||
steps:
|
||||
- uses: actions/checkout@v5
|
||||
- uses: actions/setup-go@v6
|
||||
with:
|
||||
go-version: "1.26.4"
|
||||
- name: Build
|
||||
env:
|
||||
GOOS: ${{ matrix.goos }}
|
||||
GOARCH: ${{ matrix.goarch }}
|
||||
CGO_ENABLED: "0"
|
||||
run: |
|
||||
ext=""
|
||||
if [ "$GOOS" = "windows" ]; then ext=".exe"; fi
|
||||
mkdir -p dist
|
||||
go build -o "dist/git-identity-audit-${GOOS}-${GOARCH}${ext}" .
|
||||
- uses: actions/upload-artifact@v5
|
||||
with:
|
||||
name: git-identity-audit-${{ matrix.goos }}-${{ matrix.goarch }}
|
||||
path: dist/*
|
||||
|
||||
release:
|
||||
if: startsWith(github.ref, 'refs/tags/v')
|
||||
needs: build
|
||||
runs-on: ubuntu-latest
|
||||
permissions:
|
||||
contents: write
|
||||
steps:
|
||||
- uses: actions/download-artifact@v6
|
||||
with:
|
||||
path: dist
|
||||
merge-multiple: true
|
||||
- uses: softprops/action-gh-release@v2
|
||||
with:
|
||||
files: dist/*
|
||||
Reference in New Issue
Block a user