test / test (push) Failing after 1m3s
Moves test.yml and release.yml off `runs-on: fish` (host) to an ephemeral rust:1-bookworm container on the podman runner: v4 built-in checkout (no Node), no host rustup, curl/jq installed in-container for the release upload. Keeps the bare host free of toolchain installs. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
38 lines
1.3 KiB
YAML
38 lines
1.3 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
|
|
uses: actions/checkout@v4
|
|
|
|
- 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"
|