feat: link against musl
This commit is contained in:
parent
5d08d1602a
commit
441b3d0fb5
11
.drone.yml
11
.drone.yml
|
@ -4,19 +4,20 @@ name: default
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: build
|
- name: build
|
||||||
image: "nixos/nix"
|
image: "nixery.dev/shell/nix/git/shadow"
|
||||||
environment:
|
|
||||||
USER: root
|
|
||||||
commands:
|
commands:
|
||||||
|
- useradd nixbld
|
||||||
|
- useradd -u 0 root
|
||||||
- nix --extra-experimental-features 'nix-command flakes' build
|
- nix --extra-experimental-features 'nix-command flakes' build
|
||||||
|
- cp ./result tcp-proxy
|
||||||
|
|
||||||
- name: upload
|
- name: upload
|
||||||
image: "curlimages/curl"
|
image: "nixery.dev/shell/curl"
|
||||||
environment:
|
environment:
|
||||||
TOKEN:
|
TOKEN:
|
||||||
from_secret: gitea
|
from_secret: gitea
|
||||||
commands:
|
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:
|
when:
|
||||||
ref:
|
ref:
|
||||||
- refs/tags/*
|
- refs/tags/*
|
|
@ -1,7 +1,7 @@
|
||||||
{ pkgs ? import <nixpkgs> { } }:
|
{ pkgs ? import <nixpkgs> { } }:
|
||||||
with pkgs;
|
with pkgs;
|
||||||
let
|
let
|
||||||
version = "0.0.1";
|
version = "0.0.2";
|
||||||
deps = [ ];
|
deps = [ ];
|
||||||
nativeDeps = [ ];
|
nativeDeps = [ ];
|
||||||
in
|
in
|
||||||
|
@ -10,15 +10,18 @@ pkgs.buildGo119Module {
|
||||||
inherit version;
|
inherit version;
|
||||||
src = ./.;
|
src = ./.;
|
||||||
buildInputs = [
|
buildInputs = [
|
||||||
stdenv glibc.static
|
stdenv
|
||||||
] ++deps;
|
] ++deps;
|
||||||
nativeBuildInputs = [
|
nativeBuildInputs = [
|
||||||
|
musl
|
||||||
] ++nativeDeps;
|
] ++nativeDeps;
|
||||||
tags = [ ];
|
tags = [ ];
|
||||||
|
|
||||||
|
CGO_ENABLED = 0;
|
||||||
ldflags = [
|
ldflags = [
|
||||||
"-s" "-w"
|
"-s" "-w"
|
||||||
"-linkmode external"
|
"-linkmode external"
|
||||||
"-extldflags -static"
|
"-extldflags '-static -L${musl}/lib'"
|
||||||
];
|
];
|
||||||
|
|
||||||
allowGoReference = false;
|
allowGoReference = false;
|
||||||
|
|
Loading…
Reference in a new issue