[CI Workflow] Improvments for next releses and logic #11
4 changed files with 45 additions and 26 deletions
|
@ -2,19 +2,42 @@ steps:
|
|||
- name: test/build-binary/linux-amd64
|
||||
image: golang:1.24.2
|
||||
environment:
|
||||
GOOS: "linux"
|
||||
GOARCH: "amd64"
|
||||
I_PACKAGE: "git.hackmi.ch/Phil/goshorly/utils"
|
||||
CGO_ENABLED: 0
|
||||
commands:
|
||||
- export CI_COMMIT_SHA=${CI_COMMIT_SHA}
|
||||
- go build -a -installsuffix cgo -ldflags=" -X $I_PACKAGE.CI_COMMIT_SHA=$CI_COMMIT_SHA -X $I_PACKAGE.CI_COMMIT_BRANCH=$CI_COMMIT_BRANCH -X $I_PACKAGE.CI_COMMIT_TAG=$CI_COMMIT_TAG" -o app .
|
||||
- go build -a -installsuffix cgo -ldflags=" -X $I_PACKAGE.CI_COMMIT_SHA=$CI_COMMIT_SHA -X $I_PACKAGE.CI_COMMIT_BRANCH=$CI_COMMIT_BRANCH -X $I_PACKAGE.CI_COMMIT_TAG=$CI_COMMIT_TAG" -o app-amd64 .
|
||||
|
||||
- name: test/build-binary/linux-arm64
|
||||
image: golang:1.24.2
|
||||
environment:
|
||||
GOOS: "linux"
|
||||
GOARCH: "arm64"
|
||||
I_PACKAGE: "git.hackmi.ch/Phil/goshorly/utils"
|
||||
CGO_ENABLED: 0
|
||||
commands:
|
||||
- go build -a -installsuffix cgo -ldflags=" -X $I_PACKAGE.CI_COMMIT_SHA=$CI_COMMIT_SHA -X $I_PACKAGE.CI_COMMIT_BRANCH=$CI_COMMIT_BRANCH -X $I_PACKAGE.CI_COMMIT_TAG=$CI_COMMIT_TAG" -o app-arm64 .
|
||||
|
||||
- name: test/build-docker/linux-amd64
|
||||
image: woodpeckerci/plugin-docker-buildx:5.2.2
|
||||
settings:
|
||||
platforms: linux/amd64
|
||||
dry-run: true
|
||||
repo: git.hackmi.ch/phil/goshorly
|
||||
registry: git.hackmi.ch
|
||||
platforms: linux/amd64
|
||||
depends_on:
|
||||
- test/build-binary/linux-amd64
|
||||
|
||||
- name: test/build-docker/linux-arm64
|
||||
image: woodpeckerci/plugin-docker-buildx:5.2.2
|
||||
settings:
|
||||
platforms: linux/arm64
|
||||
dry-run: true
|
||||
repo: git.hackmi.ch/phil/goshorly
|
||||
registry: git.hackmi.ch
|
||||
depends_on:
|
||||
- test/build-binary/linux-arm64
|
||||
|
||||
when:
|
||||
- event: [push, cron]
|
||||
|
|
|
@ -1,23 +1,28 @@
|
|||
steps:
|
||||
- name: build-binary/linux-amd64
|
||||
- name: dev/build-binary/linux-amd64
|
||||
image: golang:1.24.2
|
||||
environment:
|
||||
GOOS: "linux"
|
||||
GOARCH: "amd64"
|
||||
I_PACKAGE: "git.hackmi.ch/Phil/goshorly/utils"
|
||||
CGO_ENABLED: 0
|
||||
commands:
|
||||
- export CI_COMMIT_SHA=${CI_COMMIT_SHA}
|
||||
- go build -a -installsuffix cgo -ldflags=" -X $I_PACKAGE.CI_COMMIT_SHA=$CI_COMMIT_SHA -X $I_PACKAGE.CI_COMMIT_BRANCH=$CI_COMMIT_BRANCH -X $I_PACKAGE.CI_COMMIT_TAG=$CI_COMMIT_TAG" -o app .
|
||||
when:
|
||||
- event: [push, cron]
|
||||
branch: main
|
||||
- go build -a -installsuffix cgo -ldflags=" -X $I_PACKAGE.CI_COMMIT_SHA=$CI_COMMIT_SHA -X $I_PACKAGE.CI_COMMIT_BRANCH=$CI_COMMIT_BRANCH -X $I_PACKAGE.CI_COMMIT_TAG=$CI_COMMIT_TAG" -o app-linux-amd64 .
|
||||
|
||||
- name: build-and-push-docker-dev
|
||||
image: woodpeckerci/plugin-docker-buildx:5.2.2
|
||||
- name: dev/build-binary/linux-arm64
|
||||
image: golang:1.24.2
|
||||
environment:
|
||||
GOOS: "linux"
|
||||
GOARCH: "arm64"
|
||||
I_PACKAGE: "git.hackmi.ch/Phil/goshorly/utils"
|
||||
CGO_ENABLED: 0
|
||||
commands:
|
||||
- go build -a -installsuffix cgo -ldflags=" -X $I_PACKAGE.CI_COMMIT_SHA=$CI_COMMIT_SHA -X $I_PACKAGE.CI_COMMIT_BRANCH=$CI_COMMIT_BRANCH -X $I_PACKAGE.CI_COMMIT_TAG=$CI_COMMIT_TAG" -o app-linux-arm64 .
|
||||
|
||||
- name: dev/build-docker/linux-multiarch
|
||||
image: woodpeckerci/plugin-docker-buildx:5.2.2
|
||||
settings:
|
||||
platforms: linux/amd64,linux/arm/v6,linux/arm64/v8
|
||||
platforms: linux/amd64,linux/arm64
|
||||
repo: git.hackmi.ch/phil/goshorly
|
||||
registry: git.hackmi.ch
|
||||
tags: dev
|
||||
|
@ -26,20 +31,8 @@ steps:
|
|||
password:
|
||||
from_secret: reg-pass
|
||||
depends_on:
|
||||
- build-binary/linux-amd64
|
||||
when:
|
||||
- event: [push, cron]
|
||||
branch: main
|
||||
|
||||
services:
|
||||
docker-daemon:
|
||||
image: docker:28.0-dind-rootless
|
||||
commands:
|
||||
- dockerd --tls=false --host=tcp://0.0.0.0:2376
|
||||
privileged: true
|
||||
when:
|
||||
- event: [push, cron]
|
||||
branch: main
|
||||
- dev/build-binary/linux-amd64
|
||||
- dev/build-binary/linux-arm64
|
||||
|
||||
when:
|
||||
- event: [push, cron]
|
||||
|
|
|
@ -1,5 +1,8 @@
|
|||
FROM golang:1.24.2-alpine as builder
|
||||
|
||||
ENV I_PACKAGE="git.hackmi.ch/Phil/goshorly/utils"
|
||||
ENV CGO_ENABLED=0
|
||||
|
||||
RUN apk add --no-cache git make build-base
|
||||
|
||||
WORKDIR /go/src/git.hackmi.ch/goshorly
|
||||
|
|
Loading…
Add table
Reference in a new issue