Port CI to Forgejo Actions
Some checks failed
/ sbom (push) Has been skipped
/ build (darwin/arm64) (push) Successful in 1m28s
/ build (linux/amd64) (push) Successful in 1m29s
/ build (darwin/amd64) (push) Successful in 1m53s
/ build (windows/amd64) (push) Successful in 1m31s
/ build (windows/arm64) (push) Successful in 1m27s
/ build (linux/arm64) (push) Successful in 2m22s
/ build (push) Successful in 3m19s
/ docker (push) Successful in 0s
/ upload (push) Failing after 12s
/ binaries (push) Failing after 0s
Some checks failed
/ sbom (push) Has been skipped
/ build (darwin/arm64) (push) Successful in 1m28s
/ build (linux/amd64) (push) Successful in 1m29s
/ build (darwin/amd64) (push) Successful in 1m53s
/ build (windows/amd64) (push) Successful in 1m31s
/ build (windows/arm64) (push) Successful in 1m27s
/ build (linux/arm64) (push) Successful in 2m22s
/ build (push) Successful in 3m19s
/ docker (push) Successful in 0s
/ upload (push) Failing after 12s
/ binaries (push) Failing after 0s
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
parent
7c3b319190
commit
dea075cb58
2 changed files with 25 additions and 75 deletions
25
.forgejo/workflows/ci.yml
Normal file
25
.forgejo/workflows/ci.yml
Normal file
|
|
@ -0,0 +1,25 @@
|
|||
on:
|
||||
push:
|
||||
branches: ['**']
|
||||
tags: ['**']
|
||||
workflow_dispatch:
|
||||
|
||||
jobs:
|
||||
binaries:
|
||||
uses: infra/ci-snippets/.forgejo/workflows/go-binaries.yml@master
|
||||
with:
|
||||
binary-name: fms32-pro-mqtt
|
||||
build-number-var: main.BuildNumber
|
||||
build-time-var: main.BuildTime
|
||||
build-number-offset: '244'
|
||||
upload: true
|
||||
update-json: true
|
||||
secrets:
|
||||
S3_HOST: ${{ secrets.S3_HOST }}
|
||||
S3_ACCESS_KEY_ID: ${{ secrets.S3_ACCESS_KEY_ID }}
|
||||
S3_SECRET_ACCESS_KEY: ${{ secrets.S3_SECRET_ACCESS_KEY }}
|
||||
S3_BUCKET: ${{ secrets.S3_BUCKET }}
|
||||
|
||||
docker:
|
||||
uses: infra/ci-snippets/.forgejo/workflows/docker-build.yml@master
|
||||
secrets: inherit
|
||||
|
|
@ -1,75 +0,0 @@
|
|||
.parallel:
|
||||
parallel:
|
||||
matrix:
|
||||
- GOOS: "linux"
|
||||
GOARCH:
|
||||
- amd64
|
||||
- arm64
|
||||
- GOOS: "windows"
|
||||
GOARCH:
|
||||
- amd64
|
||||
- arm64
|
||||
- GOOS: "darwin"
|
||||
GOARCH:
|
||||
- amd64
|
||||
- arm64
|
||||
|
||||
stages:
|
||||
- build
|
||||
- deploy
|
||||
|
||||
build-application-binary:
|
||||
stage: build
|
||||
needs: []
|
||||
parallel: !reference [ .parallel, parallel ]
|
||||
image: golang:1.27.4
|
||||
script:
|
||||
- GOPROXY=https://goproxy.jonasled.dev,direct CGO_ENABLED=0 go build -ldflags="-s -w -X 'main.BuildNumber=${CI_PIPELINE_IID}' -X 'main.BuildTime=$(date)'" -o fms32-pro-mqtt-${GOOS}-${GOARCH} ./
|
||||
- "if [ \"${GOOS}\" = \"windows\" ]; then
|
||||
|
||||
\ mv fms32-pro-mqtt-${GOOS}-${GOARCH} fms32-pro-mqtt-${GOOS}-${GOARCH}.exe\
|
||||
|
||||
fi\n"
|
||||
artifacts:
|
||||
paths:
|
||||
- fms32-pro-mqtt-${GOOS}-${GOARCH}
|
||||
- fms32-pro-mqtt-${GOOS}-${GOARCH}.exe
|
||||
expire_in: 1 week
|
||||
|
||||
build-update-json:
|
||||
stage: build
|
||||
needs: []
|
||||
image: alpine:latest
|
||||
script:
|
||||
- |
|
||||
echo '{
|
||||
"downloadUrl": "https://s3.jonasled.de/'${S3_BUCKET}'/fms32-pro-mqtt-%GOOS%-%GOARCH%%FILEXTENSION%",
|
||||
"buildNumber": "'${CI_PIPELINE_IID}'",
|
||||
"time": "'$(date)'"
|
||||
}' > update.json
|
||||
artifacts:
|
||||
paths:
|
||||
- update.json
|
||||
expire_in: 1 week
|
||||
only:
|
||||
- master
|
||||
|
||||
upload-to-s3:
|
||||
stage: deploy
|
||||
image:
|
||||
name: minio/mc
|
||||
entrypoint: [ '' ]
|
||||
before_script:
|
||||
- mc alias set minio $S3_HOST $S3_ACCESS_KEY_ID $S3_SECRET_ACCESS_KEY
|
||||
script:
|
||||
- mc cp fms32-pro-mqtt-* minio/$S3_BUCKET/
|
||||
- mc cp update.json minio/$S3_BUCKET/
|
||||
needs:
|
||||
- build-update-json
|
||||
- build-application-binary
|
||||
only:
|
||||
- master
|
||||
|
||||
include:
|
||||
- project: 'infra/ci'
|
||||
file: '/pipelines/docker.yml'
|
||||
Loading…
Add table
Add a link
Reference in a new issue