From 937ffe2d64c33fd7b8f982cc68306ae90371ae42 Mon Sep 17 00:00:00 2001 From: alyssa Date: Sat, 30 Nov 2024 12:31:12 +0900 Subject: [PATCH] build nomad --- .github/workflows/nomad.yml | 13 +++++++++++++ nomad.sh | 26 ++++++++++++++++++++++++++ 2 files changed, 39 insertions(+) create mode 100644 .github/workflows/nomad.yml create mode 100755 nomad.sh diff --git a/.github/workflows/nomad.yml b/.github/workflows/nomad.yml new file mode 100644 index 0000000..b565400 --- /dev/null +++ b/.github/workflows/nomad.yml @@ -0,0 +1,13 @@ +name: build nomad +on: push + +jobs: + build: + runs-on: ubuntu-latest + container: + image: alpine:latest + steps: + - uses: actions/checkout@v1 + with: + submodules: recursive + - run: nomad.sh ${{ github.sha }} diff --git a/nomad.sh b/nomad.sh new file mode 100755 index 0000000..079d2fa --- /dev/null +++ b/nomad.sh @@ -0,0 +1,26 @@ +#!/bin/sh + +set -e + +alias upload="s3cmd --host=34d8c1092fc4c5853b6a5a05b08228c5.eu.r2.cloudflarestorage.com:443 --host-bucket=34d8c1092fc4c5853b6a5a05b08228c5.eu.r2.cloudflarestorage.com:443 --access_key=$BUILDS_S3_ACCESS_KEY_ID --secret_key=$BUILDS_S3_SECRET_ACCESS_KEY put /nomad.tar.gz s3://pluralkit-builds/test-nomad.tar.gz" + +set -x + +apk add bash build-base git go s3cmd nodejs npm yarn +linux-headers + +npm i -g ember-cli + +git clone --depth 1 --branch v1.9.3 https://github.com/hashicorp/nomad && cd nomad + +# run static build +# hacky... +sed -i 's/"$(GO_LDFLAGS)"/"$(GO_LDFLAGS) -extldflags \\"-static\\""/' GNUmakefile + +TARGETS=linux_amd64 make release + +mkdir -p /tmp/out/bin +cp pkg/linux_amd64/noamd /tmp/out/bin +(cd /tmp/out && tar czf /nomad.tar.gz .) + +upload /nomad.tar.gz s3://pluralkit-builds/nomad/$1/package.tar.gz