CI / Lint (push) Failing after 14m46s
CI / Test (push) Failing after 4m23s
CI / Build (darwin/amd64) (push) Skipped
CI / Build (linux/amd64) (push) Skipped
CI / Build (windows/amd64) (push) Skipped
CI / Build (darwin/arm64) (push) Skipped
CI / Build (linux/arm64) (push) Skipped
CI / Build (windows/arm64) (push) Skipped
CI / Release (push) Skipped
118 lines
3.6 KiB
YAML
118 lines
3.6 KiB
YAML
# Gitea Actions CI/CD — clip-sync
|
|
# Lint → Test → Build multi-plateforme → Release
|
|
#
|
|
# Triggered on: push to main, tags (v*), pull requests
|
|
|
|
name: CI
|
|
|
|
on:
|
|
push:
|
|
branches: [main]
|
|
tags: ["v*"]
|
|
pull_request:
|
|
branches: [main]
|
|
|
|
jobs:
|
|
# ── Lint ────────────────────────────────────────────────────────────
|
|
|
|
lint:
|
|
name: Lint
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
|
|
- uses: actions/setup-go@v5
|
|
with:
|
|
go-version: "1.21"
|
|
|
|
- name: golangci-lint
|
|
uses: golangci/golangci-lint-action@v6
|
|
with:
|
|
version: latest
|
|
args: --timeout=3m
|
|
|
|
# ── Test ─────────────────────────────────────────────────────────────
|
|
|
|
test:
|
|
name: Test
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
|
|
- uses: actions/setup-go@v5
|
|
with:
|
|
go-version: "1.21"
|
|
|
|
- name: Install xclip (for clipboard tests)
|
|
run: sudo apt-get update -qq && sudo apt-get install -y -qq xclip
|
|
|
|
- name: Run tests
|
|
run: go test ./... -v -count=1 -race -coverprofile=coverage.out -timeout 120s
|
|
|
|
- name: Coverage report
|
|
run: go tool cover -func=coverage.out
|
|
|
|
# ── Build (cross-compile) ────────────────────────────────────────────
|
|
|
|
build:
|
|
name: Build (${{ matrix.os }}/${{ matrix.arch }})
|
|
runs-on: ubuntu-latest
|
|
needs: [lint, test]
|
|
if: github.event_name == 'push' || github.event_name == 'pull_request'
|
|
strategy:
|
|
matrix:
|
|
os: [linux, windows, darwin]
|
|
arch: [amd64, arm64]
|
|
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
|
|
- uses: actions/setup-go@v5
|
|
with:
|
|
go-version: "1.21"
|
|
|
|
- name: Build
|
|
run: |
|
|
VERSION="${GITHUB_REF_NAME:-dev}"
|
|
EXT=""
|
|
[ "${{ matrix.os }}" = "windows" ] && EXT=".exe"
|
|
GOOS=${{ matrix.os }} GOARCH=${{ matrix.arch }} CGO_ENABLED=0 \
|
|
go build -ldflags "-s -w -X main.version=${VERSION}" \
|
|
-o "clip-sync-${{ matrix.os }}-${{ matrix.arch }}${EXT}" .
|
|
|
|
- name: Upload artifact
|
|
uses: actions/upload-artifact@v4
|
|
with:
|
|
name: clip-sync-${{ matrix.os }}-${{ matrix.arch }}
|
|
path: clip-sync-${{ matrix.os }}-${{ matrix.arch }}*
|
|
|
|
# ── Release ──────────────────────────────────────────────────────────
|
|
|
|
release:
|
|
name: Release
|
|
runs-on: ubuntu-latest
|
|
needs: [build]
|
|
if: startsWith(github.ref, 'refs/tags/v')
|
|
steps:
|
|
- name: Download all artifacts
|
|
uses: actions/download-artifact@v4
|
|
with:
|
|
path: artifacts/
|
|
|
|
- name: Create release
|
|
uses: gitea/action-gitea-release@v1
|
|
with:
|
|
tag_name: ${{ github.ref_name }}
|
|
name: clip-sync ${{ github.ref_name }}
|
|
body: |
|
|
## clip-sync ${{ github.ref_name }}
|
|
|
|
See [CHANGELOG.md](https://git.dracodev.net/Projets/clip-sync/src/branch/main/CHANGELOG.md) for details.
|
|
|
|
### Install
|
|
```bash
|
|
curl -sSL https://git.dracodev.net/Projets/clip-sync/raw/branch/main/install.sh | bash
|
|
```
|
|
files: |
|
|
artifacts/**/clip-sync-*
|