Compare commits
2
Commits
747dcf4a9b
...
4fa15307a7
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
4fa15307a7 | ||
|
|
65c0b6bcbe |
@@ -1,9 +1,20 @@
|
|||||||
name: check
|
name: check
|
||||||
on: [push]
|
on: [push]
|
||||||
|
# Free the shared runner: a new push cancels only the same branch's older run.
|
||||||
|
concurrency:
|
||||||
|
group: ${{ github.workflow }}-${{ github.ref }}
|
||||||
|
cancel-in-progress: true
|
||||||
jobs:
|
jobs:
|
||||||
check:
|
check:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
# Free the shared runner from a hung build.
|
||||||
|
timeout-minutes: 20
|
||||||
steps:
|
steps:
|
||||||
# actions/checkout v4.2.2, 2026-02-22
|
# actions/checkout v4.2.2, 2026-02-22
|
||||||
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
|
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
|
||||||
|
# script/cibuild needs no token, so none is left in .git/config.
|
||||||
|
with:
|
||||||
|
persist-credentials: false
|
||||||
|
# All history and tags, so git describe finds the version tag.
|
||||||
|
fetch-depth: 0
|
||||||
- run: script/cibuild
|
- run: script/cibuild
|
||||||
|
|||||||
@@ -55,7 +55,8 @@ either one is broken. We provide:
|
|||||||
- `script/build` — build the frontend for production into `dist/`, then the
|
- `script/build` — build the frontend for production into `dist/`, then the
|
||||||
static `netwatch-server` binary into the repo root with its version stamped
|
static `netwatch-server` binary into the repo root with its version stamped
|
||||||
in: `VERSION` from the environment, or when that is unset or empty,
|
in: `VERSION` from the environment, or when that is unset or empty,
|
||||||
`git describe` inside a git checkout, then `dev`
|
`git describe --tags --always --dirty` inside a git checkout, as
|
||||||
|
`script/docker` does, then `dev`
|
||||||
- `script/run` — build with `script/build`, then run `netwatch-server` with its
|
- `script/run` — build with `script/build`, then run `netwatch-server` with its
|
||||||
defaults (see [Settings](#settings))
|
defaults (see [Settings](#settings))
|
||||||
- `script/clean` — remove what `script/build` writes
|
- `script/clean` — remove what `script/build` writes
|
||||||
|
|||||||
@@ -12,7 +12,8 @@
|
|||||||
pre-1.0. No git tags. `main` is the stable branch and `next` the development
|
pre-1.0. No git tags. `main` is the stable branch and `next` the development
|
||||||
branch, which every PR targets. The frontend and the Go backend ship as one
|
branch, which every PR targets. The frontend and the Go backend ship as one
|
||||||
Docker image, and the Gitea workflow `.gitea/workflows/check.yml` runs
|
Docker image, and the Gitea workflow `.gitea/workflows/check.yml` runs
|
||||||
`script/cibuild` on every push. Working toward 1.0.0.
|
`script/cibuild` on every push, and cancels the older run on the same branch.
|
||||||
|
Working toward 1.0.0.
|
||||||
|
|
||||||
# Next Step
|
# Next Step
|
||||||
|
|
||||||
@@ -21,6 +22,20 @@ Run `make frontend-viewport-test` in CI as its own step; it is not part of
|
|||||||
|
|
||||||
# Completed Steps
|
# Completed Steps
|
||||||
|
|
||||||
|
- 2026-10-19: when `VERSION` is unset or empty, `script/build` stamps the
|
||||||
|
version from `git describe --tags --always --dirty`, as `script/docker` does
|
||||||
|
([#156](https://git.eeqj.de/sneak/netwatch/issues/156)). Without `--tags` it
|
||||||
|
skipped lightweight tags, so `make run` could report a commit where the image
|
||||||
|
built from the same tree reported the tag. Checked once with a lightweight tag
|
||||||
|
on a scratch clone: `make build` stamped it
|
||||||
|
- 2026-10-19: `.gitea/workflows/check.yml` is the sneak/prompts copy at
|
||||||
|
`0653579` ([#153](https://git.eeqj.de/sneak/netwatch/issues/153)). Its
|
||||||
|
checkout step sets `fetch-depth: 0`, so CI clones all history and tags, and
|
||||||
|
`git describe` in `script/cibuild` gives the image built from a tagged commit
|
||||||
|
the tag as its version; it gave the short commit. The checkout step also sets
|
||||||
|
`persist-credentials: false`, so the job's token is not left in `.git/config`.
|
||||||
|
A new push cancels the older run on the same branch, and a run stops after 20
|
||||||
|
minutes
|
||||||
- 2026-10-19: `script/bootstrap` keeps the `yarn` on `PATH` only when
|
- 2026-10-19: `script/bootstrap` keeps the `yarn` on `PATH` only when
|
||||||
`yarn --version` is exactly `YARN_VERSION`, and otherwise installs that
|
`yarn --version` is exactly `YARN_VERSION`, and otherwise installs that
|
||||||
version as it did when no yarn was installed
|
version as it did when no yarn was installed
|
||||||
|
|||||||
+4
-3
@@ -10,9 +10,10 @@ main() {
|
|||||||
cd "$ROOT"
|
cd "$ROOT"
|
||||||
"$ROOT/script/yarn" build
|
"$ROOT/script/yarn" build
|
||||||
|
|
||||||
# VERSION comes from the environment. Unset or empty, it is git
|
# VERSION comes from the environment. Unset or empty, it is
|
||||||
# describe, or "dev" where there is no git or no repository history.
|
# `git describe --tags --always --dirty`, as in script/docker, or
|
||||||
version="${VERSION:-$(git describe --always --dirty 2>/dev/null || echo dev)}"
|
# "dev" where there is no git or no repository history.
|
||||||
|
version="${VERSION:-$(git describe --tags --always --dirty 2>/dev/null || echo dev)}"
|
||||||
|
|
||||||
CGO_ENABLED=0 go build -trimpath \
|
CGO_ENABLED=0 go build -trimpath \
|
||||||
-ldflags "-s -w -X main.Version=$version" \
|
-ldflags "-s -w -X main.Version=$version" \
|
||||||
|
|||||||
Reference in New Issue
Block a user