Add Store support and unsigned app releases
This commit is contained in:
30
templates/rust-app/.gitlab-ci.yml
Normal file
30
templates/rust-app/.gitlab-ci.yml
Normal file
@@ -0,0 +1,30 @@
|
||||
# GitLab: on a tag (v1.2.3), build, sign, put the three store assets into the
|
||||
# project's generic package registry and make a release that links them.
|
||||
# CI/CD variable: SF_SIGNING_KEY (base64 of key.pem on one line, masked).
|
||||
# The project must be public, so TVs can download without a login.
|
||||
release:
|
||||
image: debian:trixie
|
||||
rules:
|
||||
- if: $CI_COMMIT_TAG =~ /^v/
|
||||
variables:
|
||||
SF_PACK_GIT: https://gitea.bluefox.support/bluefox/fox-in-the-box
|
||||
script:
|
||||
- apt-get update -qq
|
||||
- apt-get install -y -qq --no-install-recommends build-essential pkg-config curl ca-certificates git jq libfontconfig1-dev libfreetype-dev libxkbcommon-dev >/dev/null
|
||||
- curl -sSf https://sh.rustup.rs | sh -s -- -y -q --profile minimal
|
||||
- export PATH="$HOME/.cargo/bin:$PATH"
|
||||
- cargo install -q --locked --git "$SF_PACK_GIT" sf-pack
|
||||
- ./package.sh
|
||||
- VERSION="${CI_COMMIT_TAG#v}"
|
||||
- PKG="$CI_API_V4_URL/projects/$CI_PROJECT_ID/packages/generic/smartfox/$VERSION"
|
||||
- links="[]"
|
||||
- |
|
||||
for f in dist/*; do
|
||||
n=$(basename "$f")
|
||||
curl -fsS --header "JOB-TOKEN: $CI_JOB_TOKEN" --upload-file "$f" "$PKG/$n" >/dev/null
|
||||
links=$(echo "$links" | jq --arg n "$n" --arg u "$PKG/$n" '. + [{name: $n, url: $u, link_type: "package"}]')
|
||||
done
|
||||
- |
|
||||
jq -n --arg t "$CI_COMMIT_TAG" --argjson l "$links" '{tag_name: $t, name: $t, assets: {links: $l}}' |
|
||||
curl -fsS --header "JOB-TOKEN: $CI_JOB_TOKEN" --header "Content-Type: application/json" --data @- \
|
||||
"$CI_API_V4_URL/projects/$CI_PROJECT_ID/releases" >/dev/null
|
||||
Reference in New Issue
Block a user