vieter/.woodpecker/.build.yml

44 lines
1.2 KiB
YAML
Raw Normal View History

matrix:
PLATFORM:
- linux/amd64
- linux/arm64
2022-01-15 15:35:12 +01:00
- linux/arm/v7
2022-01-13 15:29:43 +01:00
# These checks already get performed on the feature branches
branches:
exclude: [ main, dev ]
2022-01-15 15:30:09 +01:00
platform: ${PLATFORM}
2022-01-13 15:29:43 +01:00
2022-01-13 13:40:33 +01:00
pipeline:
2022-01-15 15:49:19 +01:00
# The default build isn't needed, as alpine switches to gcc for the compiler anyways
2022-01-13 13:40:33 +01:00
debug:
image: 'chewingbever/vlang:latest'
group: 'build'
commands:
- make debug
prod:
image: 'chewingbever/vlang:latest'
2022-01-14 18:32:00 +01:00
environment:
2022-01-14 18:36:36 +01:00
- LDFLAGS=-lz -lbz2 -llzma -lexpat -lzstd -llz4 -static
2022-01-13 13:40:33 +01:00
group: 'build'
commands:
- make prod
# Make sure the binary is actually static
2022-01-14 20:43:11 +01:00
- readelf -d pvieter
2022-01-14 21:50:43 +01:00
- du -h pvieter
2022-01-14 20:43:11 +01:00
- '[ "$(readelf -d pvieter | grep NEEDED | wc -l)" = 0 ]'
2022-01-22 19:01:46 +01:00
# This removes so much, it's amazing
- strip -s pvieter
- du -h pvieter
upload:
image: 'alpine:latest'
secrets: [ s3_username, s3_password ]
commands:
# https://min.io/download#/linux
- wget https://dl.min.io/client/mc/release/linux-amd64/mc
- chmod +x mc
- ./mc alias set s3 https://s3.rustybever.be "$S3_USERNAME" "$S3_PASSWORD"
- ./mc cp pvieter "s3/vieter/commits/$CI_COMMIT_SHA/vieter-$(echo '${PLATFORM}' | sed 's:/:-:')"