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

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

42
.forgejo/workflows/ci.yml Normal file
View file

@ -0,0 +1,42 @@
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}
- {goos: darwin, goarch: amd64}
- {goos: darwin, goarch: arm64}
steps:
- uses: https://code.forgejo.org/actions/checkout@v7
- uses: https://code.forgejo.org/actions/setup-go@v7
with:
go-version: '1.24'
- name: Build
env:
GOPROXY: https://goproxy.jonasled.dev,direct
GOOS: ${{ matrix.goos }}
GOARCH: ${{ matrix.goarch }}
BUILD_NUMBER: ${{ github.run_number }}
run: |
CGO_ENABLED=0 go build -ldflags="-s -w" -o mpfeuer-firebird-migration-$GOOS-$GOARCH ./
if [ "$GOOS" = "windows" ]; then
mv mpfeuer-firebird-migration-$GOOS-$GOARCH mpfeuer-firebird-migration-$GOOS-$GOARCH.exe
fi
- uses: https://code.forgejo.org/forgejo/upload-artifact@v4
with:
name: mpfeuer-firebird-migration-${{ matrix.goos }}-${{ matrix.goarch }}
path: mpfeuer-firebird-migration-*
retention-days: 7

View file

@ -1,36 +0,0 @@
.parallel:
parallel:
matrix:
- GOOS: "linux"
GOARCH:
- amd64
- arm64
- GOOS: "windows"
GOARCH:
- amd64
- arm64
- GOOS: "darwin"
GOARCH:
- amd64
- arm64
stages:
- build
build-application-binary:
stage: build
needs: []
parallel: !reference [ .parallel, parallel ]
image: golang:1.24.2
script:
- CGO_ENABLED=0 go build -ldflags="-s -w" -o mpfeuer-firebird-migration-${GOOS}-${GOARCH} ./
- "if [ \"${GOOS}\" = \"windows\" ]; then
\ mv mpfeuer-firebird-migration-${GOOS}-${GOARCH} mpfeuer-firebird-migration-${GOOS}-${GOARCH}.exe\
fi\n"
artifacts:
paths:
- mpfeuer-firebird-migration-${GOOS}-${GOARCH}
- mpfeuer-firebird-migration-${GOOS}-${GOARCH}.exe
expire_in: 1 week