Port CI from GitLab CI to Forgejo Actions
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
parent
b8dc2e5329
commit
c65edab4ae
2 changed files with 40 additions and 28 deletions
40
.forgejo/workflows/ci.yml
Normal file
40
.forgejo/workflows/ci.yml
Normal file
|
|
@ -0,0 +1,40 @@
|
|||
name: CI
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: ["**"]
|
||||
tags: ["**"]
|
||||
workflow_dispatch:
|
||||
|
||||
jobs:
|
||||
build:
|
||||
runs-on: default
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
include:
|
||||
- {goos: linux, goarch: amd64}
|
||||
- {goos: linux, goarch: arm64}
|
||||
- {goos: windows, goarch: amd64}
|
||||
- {goos: windows, goarch: arm64}
|
||||
steps:
|
||||
- uses: https://code.forgejo.org/actions/checkout@v7
|
||||
- uses: https://code.forgejo.org/actions/setup-go@v7
|
||||
with:
|
||||
go-version: '1.27'
|
||||
- name: Build
|
||||
env:
|
||||
GOPROXY: https://goproxy.jonasled.dev,direct
|
||||
GOOS: ${{ matrix.goos }}
|
||||
GOARCH: ${{ matrix.goarch }}
|
||||
BUILD_NUMBER: ${{ github.run_number }}
|
||||
run: |
|
||||
go build -ldflags="-s -w" -o sdsmerger-$GOOS-$GOARCH ./
|
||||
if [ "$GOOS" = "windows" ]; then
|
||||
mv sdsmerger-$GOOS-$GOARCH sdsmerger-$GOOS-$GOARCH.exe
|
||||
fi
|
||||
- uses: https://code.forgejo.org/forgejo/upload-artifact@v4
|
||||
with:
|
||||
name: sdsmerger-${{ matrix.goos }}-${{ matrix.goarch }}
|
||||
path: sdsmerger-*
|
||||
retention-days: 7
|
||||
|
|
@ -1,28 +0,0 @@
|
|||
.parallel:
|
||||
parallel:
|
||||
matrix:
|
||||
- GOOS: "linux"
|
||||
GOARCH:
|
||||
- amd64
|
||||
- arm64
|
||||
- GOOS: "windows"
|
||||
GOARCH:
|
||||
- amd64
|
||||
- arm64
|
||||
|
||||
build-application-binary:
|
||||
stage: build
|
||||
needs: []
|
||||
parallel: !reference [.parallel,parallel]
|
||||
image: golang:1.27.4
|
||||
script:
|
||||
- GOPROXY=https://goproxy.jonasled.dev,direct go build -ldflags="-s -w" -o sdsmerger-${GOOS}-${GOARCH} ./
|
||||
- |
|
||||
if [ "${GOOS}" = "windows" ]; then
|
||||
mv sdsmerger-${GOOS}-${GOARCH} sdsmerger-${GOOS}-${GOARCH}.exe
|
||||
fi
|
||||
artifacts:
|
||||
paths:
|
||||
- sdsmerger-${GOOS}-${GOARCH}
|
||||
- sdsmerger-${GOOS}-${GOARCH}.exe
|
||||
expire_in: 1 week
|
||||
Loading…
Add table
Add a link
Reference in a new issue