diff --git a/.builds/alpine.yml b/.builds/alpine.yml index 5a000ee..7eec02c 100644 --- a/.builds/alpine.yml +++ b/.builds/alpine.yml @@ -8,3 +8,7 @@ tasks: - build: | cd gemserv/ cargo build +triggers: + - action: email + condition: failure + to: "" diff --git a/.builds/docker.yml b/.builds/docker.yml index 636cab1..bb93734 100644 --- a/.builds/docker.yml +++ b/.builds/docker.yml @@ -31,4 +31,4 @@ tasks: triggers: - action: email condition: failure - to: "" \ No newline at end of file + to: "" diff --git a/.builds/release-linux.yml b/.builds/release-linux.yml new file mode 100644 index 0000000..341875d --- /dev/null +++ b/.builds/release-linux.yml @@ -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: ""