[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
|
- name: test/build-binary/linux-amd64
|
||||||
image: golang:1.24.2
|
image: golang:1.24.2
|
||||||
environment:
|
environment:
|
||||||
|
GOOS: "linux"
|
||||||
|
GOARCH: "amd64"
|
||||||
I_PACKAGE: "git.hackmi.ch/Phil/goshorly/utils"
|
I_PACKAGE: "git.hackmi.ch/Phil/goshorly/utils"
|
||||||
CGO_ENABLED: 0
|
CGO_ENABLED: 0
|
||||||
commands:
|
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-amd64 .
|
||||||
- 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 .
|
|
||||||
|
- 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
|
- name: test/build-docker/linux-amd64
|
||||||
image: woodpeckerci/plugin-docker-buildx:5.2.2
|
image: woodpeckerci/plugin-docker-buildx:5.2.2
|
||||||
settings:
|
settings:
|
||||||
|
platforms: linux/amd64
|
||||||
dry-run: true
|
dry-run: true
|
||||||
repo: git.hackmi.ch/phil/goshorly
|
repo: git.hackmi.ch/phil/goshorly
|
||||||
registry: git.hackmi.ch
|
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:
|
when:
|
||||||
- event: [push, cron]
|
- event: [push, cron]
|
||||||
|
|
|
@ -1,23 +1,28 @@
|
||||||
steps:
|
steps:
|
||||||
- name: build-binary/linux-amd64
|
- name: dev/build-binary/linux-amd64
|
||||||
image: golang:1.24.2
|
image: golang:1.24.2
|
||||||
environment:
|
environment:
|
||||||
|
GOOS: "linux"
|
||||||
|
GOARCH: "amd64"
|
||||||
I_PACKAGE: "git.hackmi.ch/Phil/goshorly/utils"
|
I_PACKAGE: "git.hackmi.ch/Phil/goshorly/utils"
|
||||||
CGO_ENABLED: 0
|
CGO_ENABLED: 0
|
||||||
commands:
|
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-linux-amd64 .
|
||||||
- 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
|
|
||||||
|
|
||||||
- name: build-and-push-docker-dev
|
- name: dev/build-binary/linux-arm64
|
||||||
image: woodpeckerci/plugin-docker-buildx:5.2.2
|
image: golang:1.24.2
|
||||||
environment:
|
environment:
|
||||||
|
GOOS: "linux"
|
||||||
|
GOARCH: "arm64"
|
||||||
I_PACKAGE: "git.hackmi.ch/Phil/goshorly/utils"
|
I_PACKAGE: "git.hackmi.ch/Phil/goshorly/utils"
|
||||||
CGO_ENABLED: 0
|
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:
|
settings:
|
||||||
platforms: linux/amd64,linux/arm/v6,linux/arm64/v8
|
platforms: linux/amd64,linux/arm64
|
||||||
repo: git.hackmi.ch/phil/goshorly
|
repo: git.hackmi.ch/phil/goshorly
|
||||||
registry: git.hackmi.ch
|
registry: git.hackmi.ch
|
||||||
tags: dev
|
tags: dev
|
||||||
|
@ -26,20 +31,8 @@ steps:
|
||||||
password:
|
password:
|
||||||
from_secret: reg-pass
|
from_secret: reg-pass
|
||||||
depends_on:
|
depends_on:
|
||||||
- build-binary/linux-amd64
|
- dev/build-binary/linux-amd64
|
||||||
when:
|
- dev/build-binary/linux-arm64
|
||||||
- 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
|
|
||||||
|
|
||||||
when:
|
when:
|
||||||
- event: [push, cron]
|
- event: [push, cron]
|
||||||
|
|
|
@ -1,5 +1,8 @@
|
||||||
FROM golang:1.24.2-alpine as builder
|
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
|
RUN apk add --no-cache git make build-base
|
||||||
|
|
||||||
WORKDIR /go/src/git.hackmi.ch/goshorly
|
WORKDIR /go/src/git.hackmi.ch/goshorly
|
||||||
|
|
Loading…
Add table
Reference in a new issue