feat: link against musl
continuous-integration/drone/push Build is failing Details
continuous-integration/drone/tag Build is failing Details

This commit is contained in:
Garionion 2023-01-28 20:55:52 +01:00
parent 5d08d1602a
commit 90f4951475
Signed by: garionion
SSH Key Fingerprint: SHA256:6uQQGh4dHIdYnrR+qeLdgx5SDmbttGp2HusA73563QA
2 changed files with 13 additions and 8 deletions

View File

@ -4,19 +4,21 @@ name: default
steps:
- name: build
image: "nixos/nix"
environment:
USER: root
image: "nixery.dev/shell/shadow/bashinteractive/coreutils-full/nix/findutils/git"
commands:
- useradd -u 0 root
- groupadd -g 30000 nixbld
- useradd -u 30000 -g nixbld -G nixbld nixbld
- nix --extra-experimental-features 'nix-command flakes' build
- cp ./result tcp-proxy
- name: upload
image: "curlimages/curl"
image: "nixery.dev/shell/curl"
environment:
TOKEN:
from_secret: gitea
commands:
- curl --user garionion:$TOKEN --upload-file ./result/bin/tcp-proxy https://git.entr0py.de/api/packages/garionion/generic/tcp-stream-proxy/${DRONE_TAG}/tcp-proxy
- curl --user garionion:$TOKEN --upload-file ./tcp-proxy https://git.entr0py.de/api/packages/garionion/generic/tcp-stream-proxy/${DRONE_TAG}/tcp-proxy
when:
ref:
- refs/tags/*

View File

@ -1,7 +1,7 @@
{ pkgs ? import <nixpkgs> { } }:
with pkgs;
let
version = "0.0.1";
version = "0.0.2";
deps = [ ];
nativeDeps = [ ];
in
@ -10,15 +10,18 @@ pkgs.buildGo119Module {
inherit version;
src = ./.;
buildInputs = [
stdenv glibc.static
stdenv
] ++deps;
nativeBuildInputs = [
musl
] ++nativeDeps;
tags = [ ];
CGO_ENABLED = 0;
ldflags = [
"-s" "-w"
"-linkmode external"
"-extldflags -static"
"-extldflags '-static -L${musl}/lib'"
];
allowGoReference = false;