mirror of
https://git.sr.ht/~ashkeel/strimertul
synced 2024-09-06 00:50:51 +00:00
ci: add wip drone config
All checks were successful
continuous-integration/drone/tag Build is passing
All checks were successful
continuous-integration/drone/tag Build is passing
This commit is contained in:
parent
145c0846f6
commit
962427af86
2 changed files with 67 additions and 0 deletions
30
.drone.yml
Normal file
30
.drone.yml
Normal file
|
@ -0,0 +1,30 @@
|
||||||
|
kind: pipeline
|
||||||
|
type: docker
|
||||||
|
name: default
|
||||||
|
trigger:
|
||||||
|
event:
|
||||||
|
- tag
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- name: Build
|
||||||
|
image: ghcr.io/abjrcode/cross-wails:v2.6.0
|
||||||
|
commands:
|
||||||
|
- apt-get update
|
||||||
|
- apt-get install -y upx
|
||||||
|
- GOOS=linux GOARCH=amd64 CC=x86_64-linux-gnu-gcc wails build -ldflags "-X main.appVersion=$DRONE_TAG" -platform linux/amd64 -upx -o strimertul-amd64
|
||||||
|
- GOOS=linux GOARCH=arm64 CC=aarch64-linux-gnu-gcc wails build -ldflags "-X main.appVersion=$DRONE_TAG" -m -nosyncgomod -skipbindings -s -platform linux/arm64 -upx -o strimertul-arm64
|
||||||
|
- GOOS=windows GOARCH=amd64 CC=x86_64-w64-mingw32-gcc wails build -ldflags "-X main.appVersion=$DRONE_TAG" -m -nosyncgomod -skipbindings -s -platform windows/amd64 -upx
|
||||||
|
|
||||||
|
- name: Upload
|
||||||
|
image: plugins/s3
|
||||||
|
settings:
|
||||||
|
bucket: strimertul-builds
|
||||||
|
access_key:
|
||||||
|
from_secret: minio_access
|
||||||
|
secret_key:
|
||||||
|
from_secret: minio_secret
|
||||||
|
source: /drone/src/build/bin/**/*
|
||||||
|
target: /$DRONE_TAG/
|
||||||
|
strip_prefix: /drone/src/build/bin/
|
||||||
|
path_style: true
|
||||||
|
endpoint: https://artifacts.fromouter.space
|
37
Dockerfile
Normal file
37
Dockerfile
Normal file
|
@ -0,0 +1,37 @@
|
||||||
|
ARG BASE_IMAGE=ghcr.io/abjrcode/cross-wails:v2.6.0
|
||||||
|
|
||||||
|
FROM ${BASE_IMAGE} as builder
|
||||||
|
|
||||||
|
WORKDIR /usr/src/app
|
||||||
|
|
||||||
|
COPY go.mod go.sum ./
|
||||||
|
|
||||||
|
RUN go mod download
|
||||||
|
|
||||||
|
COPY . .
|
||||||
|
|
||||||
|
# Docker injects the value of BUILDARCH into the build process
|
||||||
|
ARG BUILDARCH
|
||||||
|
|
||||||
|
# Needed atm due to https://github.com/wailsapp/wails/issues/1921
|
||||||
|
RUN set -exo pipefail; \
|
||||||
|
if [ "${BUILDARCH}" = "amd64" ]; then \
|
||||||
|
GOOS=linux GOARCH=amd64 CC=x86_64-linux-gnu-gcc wails build -platform linux/amd64 -o example-amd64; \
|
||||||
|
GOOS=linux GOARCH=arm64 CC=aarch64-linux-gnu-gcc wails build -skipbindings -s -platform linux/arm64 -o example-arm64; \
|
||||||
|
GOOS=windows GOARCH=amd64 CC=x86_64-w64-mingw32-gcc wails build -skipbindings -s -platform windows/amd64; \
|
||||||
|
else \
|
||||||
|
GOOS=linux GOARCH=arm64 CC=aarch64-linux-gnu-gcc wails build -platform linux/arm64 -o example-arm64; \
|
||||||
|
GOOS=linux GOARCH=amd64 CC=x86_64-linux-gnu-gcc wails build -skipbindings -s -platform linux/amd64 -o example-amd64; \
|
||||||
|
GOOS=windows GOARCH=amd64 CC=x86_64-w64-mingw32-gcc wails build -skipbindings -s -platform windows/amd64; \
|
||||||
|
fi;
|
||||||
|
|
||||||
|
ENTRYPOINT [ "/bin/bash" ]
|
||||||
|
|
||||||
|
#############################################################
|
||||||
|
|
||||||
|
FROM ${BASE_IMAGE}
|
||||||
|
|
||||||
|
COPY --from=builder /usr/src/app/build/bin /out
|
||||||
|
|
||||||
|
ENTRYPOINT [ "sh", "-c" ]
|
||||||
|
CMD [ "cp -r /out/. /artifacts/" ]
|
Loading…
Reference in a new issue