Release / release (push) Successful in 6m46s
- Read button (desktop and web): reads the tag now, bypassing the status cache, and puts its first link or text record into the input field so it can be copied to another tag. POST /api/read in the web version. - Raw memory: every 4-byte page from page 0 (UID, lock bytes, CC, data) in hex and ASCII, collapsed by default. - Content now shows the records and the note together (a locked tag showed only "read-only" before); read failures are flagged with read_failed instead of matching message text. - .gitea/workflows/release.yml: on a v* tag, tests and clippy, then Linux (ubuntu-22.04, glibc 2.35) and Windows (MinGW cross-build) packages attached to the tag's release with its CHANGELOG.md section. - README: reading, why the reader program runs on the reader's machine, releases.
89 lines
3.1 KiB
YAML
89 lines
3.1 KiB
YAML
# Release builds on git.b4l.co.th (Gitea Actions).
|
|
#
|
|
# On a v* tag: tests, then the Linux and Windows x86_64 binaries (desktop app
|
|
# and web version), packaged and attached to the tag's release (created when
|
|
# missing, text from CHANGELOG.md). On demand (workflow_dispatch) the same
|
|
# packages become the artifact `nfc-writer-packages` instead.
|
|
#
|
|
# Linux is built on ubuntu-22.04 so the binary needs only glibc 2.35 (Debian 12,
|
|
# Ubuntu 22.04 and newer). Windows is cross-built with MinGW-w64. macOS has no
|
|
# runner here: build it on a Mac (README, "Build and run").
|
|
name: Release
|
|
|
|
on:
|
|
push:
|
|
tags: ['v*']
|
|
workflow_dispatch:
|
|
|
|
env:
|
|
CARGO_TERM_COLOR: always
|
|
RUST_TOOLCHAIN: "1.98.1"
|
|
|
|
jobs:
|
|
release:
|
|
runs-on: ubuntu-22.04
|
|
timeout-minutes: 60
|
|
permissions:
|
|
contents: write
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
|
|
- name: System packages
|
|
run: |
|
|
SUDO=$(command -v sudo || true)
|
|
$SUDO apt-get update -qq
|
|
$SUDO apt-get install -y -qq curl ca-certificates gcc libc6-dev pkg-config \
|
|
libpcsclite-dev gcc-mingw-w64-x86-64 zip python3
|
|
|
|
- name: Rust toolchain
|
|
run: |
|
|
if ! command -v rustup >/dev/null && [ ! -x "$HOME/.cargo/bin/rustup" ]; then
|
|
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y --profile minimal --default-toolchain none
|
|
fi
|
|
export PATH="$HOME/.cargo/bin:$PATH"
|
|
echo "$HOME/.cargo/bin" >> "$GITHUB_PATH"
|
|
rustup toolchain install "$RUST_TOOLCHAIN" --profile minimal -c clippy -t x86_64-pc-windows-gnu
|
|
rustup default "$RUST_TOOLCHAIN"
|
|
rustc --version
|
|
|
|
- name: Tests and clippy
|
|
run: |
|
|
cargo test --locked
|
|
cargo clippy --locked --all-targets -- -D warnings
|
|
|
|
- name: Build
|
|
run: |
|
|
cargo build --locked --release
|
|
cargo build --locked --release --target x86_64-pc-windows-gnu
|
|
|
|
- name: Package
|
|
run: |
|
|
case "$GITHUB_REF" in
|
|
refs/tags/*) version="$GITHUB_REF_NAME" ;;
|
|
*) version="dev-${GITHUB_SHA::7}" ;;
|
|
esac
|
|
mkdir -p dist
|
|
linux="nfc-writer-$version-linux-x86_64"
|
|
mkdir "$linux"
|
|
cp target/release/nfc-writer target/release/nfc-writer-web README.md "$linux/"
|
|
tar czf "dist/$linux.tar.gz" "$linux"
|
|
windows="nfc-writer-$version-windows-x86_64"
|
|
mkdir "$windows"
|
|
cp target/x86_64-pc-windows-gnu/release/nfc-writer.exe \
|
|
target/x86_64-pc-windows-gnu/release/nfc-writer-web.exe README.md "$windows/"
|
|
zip -qr "dist/$windows.zip" "$windows"
|
|
ls -l dist
|
|
|
|
- name: Attach to the release
|
|
if: startsWith(github.ref, 'refs/tags/v')
|
|
env:
|
|
TOKEN: ${{ secrets.GITEA_TOKEN }}
|
|
run: python3 .gitea/scripts/release-attach.py dist/*
|
|
|
|
- name: Artifact (on-demand runs)
|
|
if: "!startsWith(github.ref, 'refs/tags/v')"
|
|
uses: https://github.com/christopherHX/gitea-upload-artifact@v4
|
|
with:
|
|
name: nfc-writer-packages
|
|
path: dist/
|