Port CI from GitLab CI to Forgejo Actions
All checks were successful
CI / build (amd64, linux) (push) Successful in 54s
CI / build (amd64, windows) (push) Successful in 1m2s
CI / build (arm64, linux) (push) Successful in 54s
CI / build (arm64, windows) (push) Successful in 1m1s

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
Jonas Leder 2026-11-18 10:50:39 +01:00
commit c65edab4ae
2 changed files with 40 additions and 28 deletions

40
.forgejo/workflows/ci.yml Normal file
View 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

View file

@ -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