diff --git a/.forgejo/workflows/verify.yaml b/.forgejo/workflows/verify.yaml index 2d4e590..b20dc0f 100644 --- a/.forgejo/workflows/verify.yaml +++ b/.forgejo/workflows/verify.yaml @@ -39,9 +39,12 @@ jobs: useradd -m ci && chown -R ci:ci . git config --global --add safe.directory "$PWD" - - name: Build - run: just ci build - + - name: Text matching checks + run: just ci todos-assess version-assess spell + - name: Schema lint + run: just ci schema-lint + - name: Deny + run: just ci deny - name: Format run: just ci format-assess - name: Lint diff --git a/.justfile b/.justfile index 9ae185c..a3841a2 100644 --- a/.justfile +++ b/.justfile @@ -51,7 +51,7 @@ alias wc := run-watch-containerized [private] assess-quick: - {{ just_cmd }} lint check test-cover-quick spell + {{ just_cmd }} lint check test-cover-quick spell schema-lint [private] assess-run-quick: @@ -219,8 +219,8 @@ mutate-single *cargo_test_args: # Tag HEAD with version from Cargo.toml [script, group: 'assess'] tag commit="HEAD": update - if [ "{{ last_tag }}" = "{{ manifest_version }}" ]; then - echo "Last tag {{ last_tag }} and manifest ({{ manifest_version }}) already match" + if [ "{{ last_local_tag }}" = "{{ manifest_version }}" ]; then + echo "Last tag {{ last_local_tag }} and manifest ({{ manifest_version }}) already match" exit elif [ "{{ manifest_version }}" != "{{ lockfile_version }}" ]; then echo "Manifest and lockfile versions don't match: update failed?" @@ -231,15 +231,15 @@ tag commit="HEAD": update {{ just_cmd }} version-assess # Verify and push -[group: 'develop'] -push: verify +[group: 'develop', env("JUST", "1")] +push: verify && (version-assess "true") git push git push --tags alias p := push # Push without verifying -[group: 'develop'] +[group: 'develop', env("JUST", "1")] push-unsafe: git push --no-verify git push --tags --no-verify @@ -355,16 +355,22 @@ alias v := verify # Check tag-manifest consistency [script, group: 'assess'] -version-assess: update - if - [ "{{ last_tag }}" != "{{ lockfile_version }}" ] \ - || [ "{{ last_tag }}" != "{{ lockfile_version }}" ] - then - printf 'Last tag: %s\nManifest: %s\nLockfile: %s\n' \ - "{{ last_tag }}" \ - "{{ manifest_version }}" \ - "{{ lockfile_version }}" - exit 1 +[arg("remote", long="remote", short="r", value="true")] +version-assess remote="false": update + last_remote_tag=$( + git ls-remote --tags --sort=-creatordate origin | + head -n 1 | tr -d v | cut -d / -f 3 + ) + printf 'Local: %s\nRemote: %s\nManifest: %s\nLockfile: %s\n' \ + "{{ last_local_tag }}" \ + "$last_remote_tag" \ + "{{ manifest_version }}" \ + "{{ lockfile_version }}" + test "{{ last_local_tag }}" = "{{ lockfile_version }}" + test "{{ last_local_tag }}" = "{{ manifest_version }}" + if {{ if remote == "true" { "true" } else { "false" } }}; then + echo test "{{ last_local_tag }}" = "$last_remote_tag" + test "{{ last_local_tag }}" = "$last_remote_tag" fi alias va := version-assess @@ -481,7 +487,7 @@ just_cmd_no_ts := 'just --explain --command-color green' watch_cmd := "watchexec -qc -r -e rs,toml,html,css --color always -- " cover_cmd := 'cargo llvm-cov --color always --ignore-filename-regex "main\.rs|log\.rs"' -last_tag := `git tag --sort=-creatordate | head -1 | tr -d v` +last_local_tag := `git tag --sort=-creatordate | head -1 | tr -d v` manifest_version := `grep "^version" Cargo.toml | cut -d \" -f 2` lockfile_version := ``` grep -A 1 'name = "en"' Cargo.lock \ diff --git a/Cargo.lock b/Cargo.lock index daa0607..d0133a5 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -238,7 +238,7 @@ dependencies = [ [[package]] name = "en" -version = "0.4.1-alpha" +version = "0.4.0-alpha" dependencies = [ "axum", "serde", diff --git a/Cargo.toml b/Cargo.toml index a3b9a52..5c79e7d 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "en" -version = "0.4.1-alpha" +version = "0.4.0-alpha" description = "A non-linear writing instrument." license = "AGPL-3.0-only"