Files
enok/.gitea/workflows/release.yml
blandClaude Opus 4.8 e6c2efc000
test / test (push) Successful in 2m19s
ci: use v4 built-in checkout (builtin:checkout), not actions/checkout@v4
actions/checkout@v4 is a Node action; the runner downloads it and execs it
with `node`, which the slim rust image lacks (exit 127), and the action-copy
also trips a podman path quirk. `builtin:checkout` is gitea-runner v4's native
Go checkout: no download, no Node, no action copy.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-09-28 12:16:56 +02:00

39 lines
1.4 KiB
YAML

name: Release enok
# Bygger enok og legger binærfilen ved utgivelsen, slik at byggeprosjektene kan hente den
# og lage energirapporter uten å ha Rust installert.
#
# Kjører i en efemer rust-container på podman-runneren (kasse), ikke på verten.
on:
release:
types: [published]
jobs:
bygg:
runs-on: ubuntu-latest
container:
image: docker.io/library/rust:1-bookworm
steps:
- name: Hent koden
# v4 sin innebygde Go-checkout: ingen nedlasting, ingen Node i avbildet.
uses: builtin:checkout
- name: Bygg
run: cargo build --release --locked
- name: Kontroller
run: cargo test --release --locked
- name: Legg binærfilen ved utgivelsen
env:
TOKEN: ${{ github.token }}
run: |
# curl/jq finnes ikke i rust-avbildet; installeres i den efemere containeren.
apt-get update && apt-get install -y --no-install-recommends curl jq ca-certificates
REL_ID=$(curl --silent --fail --header "Authorization: token $TOKEN" \
"$GITHUB_SERVER_URL/api/v1/repos/$GITHUB_REPOSITORY/releases/tags/$GITHUB_REF_NAME" | jq -r '.id')
curl --silent --show-error --fail --header "Authorization: token $TOKEN" \
--form "attachment=@target/release/enok" \
"$GITHUB_SERVER_URL/api/v1/repos/$GITHUB_REPOSITORY/releases/$REL_ID/assets?name=enok"