Add Store support and unsigned app releases
This commit is contained in:
40
templates/rust-app/.gitea/workflows/release.yml
Normal file
40
templates/rust-app/.gitea/workflows/release.yml
Normal file
@@ -0,0 +1,40 @@
|
||||
# Gitea / Forgejo (Codeberg): on a tag (v1.2.3), build, sign and publish a
|
||||
# release with the three store assets. Secret: SF_SIGNING_KEY (base64 of
|
||||
# key.pem on one line). The job token creates the release.
|
||||
name: release
|
||||
on:
|
||||
push:
|
||||
tags: ["v*"]
|
||||
jobs:
|
||||
release:
|
||||
runs-on: ubuntu-latest
|
||||
container:
|
||||
image: debian:trixie
|
||||
env:
|
||||
SF_PACK_GIT: https://gitea.bluefox.support/bluefox/fox-in-the-box
|
||||
steps:
|
||||
- name: Checkout
|
||||
run: |
|
||||
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
|
||||
git clone --depth 1 --branch "$GITHUB_REF_NAME" \
|
||||
"${GITHUB_SERVER_URL%%://*}://oauth2:${{ secrets.GITHUB_TOKEN }}@${GITHUB_SERVER_URL#*://}/${GITHUB_REPOSITORY}.git" src
|
||||
- name: Build and sign
|
||||
env:
|
||||
SF_SIGNING_KEY: ${{ secrets.SF_SIGNING_KEY }}
|
||||
run: |
|
||||
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
|
||||
cd src && ./package.sh
|
||||
- name: Release
|
||||
env:
|
||||
TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
run: |
|
||||
api="$GITHUB_SERVER_URL/api/v1/repos/$GITHUB_REPOSITORY/releases"
|
||||
id=$(curl -fsS -H "Authorization: token $TOKEN" -H "Content-Type: application/json" \
|
||||
-d "{\"tag_name\":\"$GITHUB_REF_NAME\",\"name\":\"$GITHUB_REF_NAME\"}" "$api" | jq -r .id)
|
||||
for f in src/dist/*; do
|
||||
curl -fsS -H "Authorization: token $TOKEN" -F "attachment=@$f" "$api/$id/assets?name=$(basename "$f")" >/dev/null
|
||||
done
|
||||
Reference in New Issue
Block a user