All checks were successful
release / release (push) Successful in 34s
Split from the Fennec OS repository (apps/youtube). The id is now support.bluefox.youtube; casting from a phone asks for the new `dial` permission. A tag (v1.2.3) builds and publishes the store release. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
53 lines
2.1 KiB
YAML
53 lines
2.1 KiB
YAML
# On a tag (v1.2.3): build the two store assets and publish them as a release.
|
|
#
|
|
# Runner hygiene (shared host, little disk): runs in the runner image that is
|
|
# already on the host (no image pull), uses no `uses:` actions (no action
|
|
# cache), and deletes everything it made at the end.
|
|
name: release
|
|
on:
|
|
push:
|
|
tags: ["v*"]
|
|
jobs:
|
|
release:
|
|
runs-on: build
|
|
container:
|
|
image: docker.gitea.com/runner-images:ubuntu-latest
|
|
env:
|
|
W: /tmp/fennec-youtube
|
|
CARGO_HOME: /tmp/fennec-youtube/cargo
|
|
RUSTUP_HOME: /tmp/fennec-youtube/rustup
|
|
CARGO_TARGET_DIR: /tmp/fennec-youtube/target
|
|
SDK_GIT: https://gitea.bluefox.support/fennec/sdk
|
|
SDK_TAG: v0.1.0
|
|
steps:
|
|
- name: Checkout
|
|
run: |
|
|
mkdir -p "$W"
|
|
git clone --depth 1 --branch "$GITHUB_REF_NAME" \
|
|
"${GITHUB_SERVER_URL%%://*}://oauth2:${{ secrets.GITHUB_TOKEN }}@${GITHUB_SERVER_URL#*://}/${GITHUB_REPOSITORY}.git" "$W/src"
|
|
v=$(sed -n 's/^version *= *"\(.*\)".*/\1/p' "$W/src/app.toml" | head -1)
|
|
[ "v$v" = "$GITHUB_REF_NAME" ] || { echo "tag $GITHUB_REF_NAME, but app.toml says $v" >&2; exit 1; }
|
|
- name: sf-pack
|
|
run: |
|
|
curl -sSf https://sh.rustup.rs | sh -s -- -y -q --profile minimal --no-modify-path
|
|
"$CARGO_HOME/bin/cargo" install -q --locked --git "$SDK_GIT" --tag "$SDK_TAG" sf-pack
|
|
- name: Build
|
|
run: |
|
|
export PATH="$CARGO_HOME/bin:$PATH"
|
|
"$W/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" | grep -o "\"id\":[0-9]*" | head -1 | cut -d: -f2)
|
|
for f in "$W"/src/dist/*; do
|
|
curl -fsS -H "Authorization: token $TOKEN" -F "attachment=@$f" "$api/$id/assets?name=$(basename "$f")" >/dev/null
|
|
done
|
|
- name: Clean up
|
|
if: always()
|
|
run: |
|
|
rm -rf "$W"
|
|
df -h / | tail -1
|