Added release-linux.yml to automatically build and upload tagged releases for linux

This commit is contained in:
int 80h 2021-12-27 19:54:34 -05:00
parent 34494da320
commit 57113d61c4
3 changed files with 40 additions and 1 deletions

View File

@ -8,3 +8,7 @@ tasks:
- build: |
cd gemserv/
cargo build
triggers:
- action: email
condition: failure
to: "<int@80h.dev>"

View File

@ -31,4 +31,4 @@ tasks:
triggers:
- action: email
condition: failure
to: "<int@80h.dev>"
to: "<int@80h.dev>"

35
.builds/release-linux.yml Normal file
View File

@ -0,0 +1,35 @@
image: alpine/edge
packages:
- rustup
- build-base
sources:
- https://git.sr.ht/~int80h/gemserv
environment:
project: gemserv
os: linux
target: x86_64-unknown-linux-musl
secrets:
- d292a96c-3d20-46e8-b7e5-5a969baaa60f
tasks:
- skip_if_not_release: |
cd $project
git describe --exact-match HEAD || complete-build
- setup: |
rustup-init -t $target -y
- build: |
cd $project
source $HOME/.cargo/env
cargo build --target $target --release
strip -s ./target/$target/release/"$project"
- publish: |
cd $project
tag=$(git describe --exact-match HEAD)
mkdir "$project-$tag-$os-x86_64"
cp ./target/$target/release/"$project" config.toml README LICENSE "$project-$tag-$os-x86_64/"
tar cvzf "./$project-$tag-$os-x86_64.tar.gz" "./$project-$tag-$os-x86_64"
set +x
curl -H Authorization:"token $(< ~/.token)" -F file=@"$project-$tag-$os-x86_64.tar.gz" https://git.sr.ht/api/repos/"$project"/artifacts/"$tag"
triggers:
- action: email
condition: failure
to: "<int@80h.dev>"