From e03307be63d4d210110522ea0538c8f28d6afe53 Mon Sep 17 00:00:00 2001 From: Compot Developer Date: Sun, 18 Oct 2026 12:58:44 +0000 Subject: [PATCH 1/2] ci: the build workflow counts as build; a no-release label skips the version (#239) --- .github/check-version.sh | 25 +++++++++++++++++++------ .github/workflows/build.yml | 10 ++++++++-- 2 files changed, 27 insertions(+), 8 deletions(-) diff --git a/.github/check-version.sh b/.github/check-version.sh index cd6d813..5d27bdf 100755 --- a/.github/check-version.sh +++ b/.github/check-version.sh @@ -4,11 +4,17 @@ # but not versionName in android/app/build.gradle. A new version must be # MAJOR.MINOR.PATCH without leading zeros, greater than the base one, and # have its section in CHANGELOG.md ("## — YYYY-MM-DD") that the -# base branch does not have yet. android/ counts as app or build (its unit -# tests in android/app/src/test do not); docs, screenshots and the -# workflows in .github/ need no new version. The format is checked only -# when the version changes, so the 2.xx versions before MAJOR.MINOR.PATCH -# stay valid until the next app change. +# base branch does not have yet. android/ (without its unit tests in +# android/app/src/test and its Markdown files) and the build workflow +# .github/workflows/build.yml count as app or build: the workflow holds +# build steps too, and the script cannot tell them from the others. Docs, +# screenshots and the rest of .github/ need no new version. +# NO_RELEASE=true (the pull request's `no-release` label) lets a change to +# the app or the build through without a new version, for changes that +# leave the APKs as they are (a test or publication step in the workflow, +# a comment). The format is checked only when the version changes, so the +# 2.xx versions before MAJOR.MINOR.PATCH stay valid until the next app +# change. # # Usage: .github/check-version.sh [BASE] (default origin/v2; CI passes # HEAD^1, the base side of the pull request's merge commit) @@ -33,9 +39,16 @@ ver() { new=$(ver HEAD < "$gradle") old=$(git show "$base:$gradle" | ver "$base") -changed=$(git diff --name-only "$base"...HEAD -- android ':(exclude)android/app/src/test') +changed=$(git diff --name-only "$base"...HEAD -- android .github/workflows/build.yml \ + ':(exclude)android/app/src/test' ':(exclude,glob)**/*.md') if [ "$new" = "$old" ]; then + if [ -n "$changed" ] && [ "${NO_RELEASE:-}" = true ]; then + echo "::notice::the app or its build changed, versionName stays $old: the no-release" \ + "label says the APKs do not change" + echo "$changed" + exit 0 + fi if [ -n "$changed" ]; then echo "::error::the app or its build changed, versionName is still $old:" \ "bump PATCH (fix) or MINOR (feature) and add its CHANGELOG.md section" diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 1ccd300..9f3877d 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -2,6 +2,8 @@ name: Build on: push: pull_request: + # labeled / unlabeled: the version check reads the no-release label + types: [opened, synchronize, reopened, labeled, unlabeled] workflow_dispatch: inputs: commit_hash: @@ -24,8 +26,9 @@ permissions: contents: read jobs: - # Pull requests: a change to the app or its build comes with a new versionName - # (MAJOR.MINOR.PATCH) and its CHANGELOG.md section (.github/check-version.sh, #230) + # Pull requests: a change to the app or its build (android/, this workflow) comes with a new + # versionName (MAJOR.MINOR.PATCH) and its CHANGELOG.md section (.github/check-version.sh, #230); + # the no-release label lets a change that keeps the APKs as they are through without one (#239) version: # basic keeps its own workflow and version file (app/build.gradle) if: github.event_name == 'pull_request' && github.base_ref == 'v2' @@ -40,6 +43,9 @@ jobs: # base it was made from, so both versions come from the same base. - name: App changes come with a new version run: .github/check-version.sh HEAD^1 + env: + # a change that leaves the APKs as they are may skip the new version + NO_RELEASE: ${{ contains(github.event.pull_request.labels.*.name, 'no-release') }} # Unit tests and lint; also runs for pull requests from forks (no secrets needed) test: From 70c051dada21c6e342fa5e48d82af3973393eda7 Mon Sep 17 00:00:00 2001 From: Compot Developer Date: Sun, 18 Oct 2026 13:10:03 +0000 Subject: [PATCH 2/2] =?UTF-8?q?docs:=20testing.md=20=E2=80=94=20the=20buil?= =?UTF-8?q?d=20workflow=20needs=20a=20new=20version=20or=20the=20no-releas?= =?UTF-8?q?e=20label=20(#239)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docs/testing.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/testing.md b/docs/testing.md index 6acab53..b23d528 100644 --- a/docs/testing.md +++ b/docs/testing.md @@ -47,7 +47,7 @@ CI is the reference: the project does not depend on local builds. ## Versions and releases -- Versions are **`MAJOR.MINOR.PATCH`** (`versionName` in `android/app/build.gradle`): PATCH for fixes and small changes, MINOR for a new feature, MAJOR for an incompatible change or a large update, only when the maintainer decides. Every pull request that changes the app or its build (`android/`, except the unit tests) bumps the version as its last commit before the merge: `versionName` by that rule and `versionCode` +1. Docs-only, test-only and CI-only pull requests do not. Numbers are not reserved for open pull requests: each one takes the next number when it is merged. CI checks this on every pull request (`.github/check-version.sh`): a new number must be canonical (no leading zeros), greater than the base one, and come with its own `CHANGELOG.md` section. +- Versions are **`MAJOR.MINOR.PATCH`** (`versionName` in `android/app/build.gradle`): PATCH for fixes and small changes, MINOR for a new feature, MAJOR for an incompatible change or a large update, only when the maintainer decides. Every pull request that changes the app or its build (`android/`, except the unit tests and Markdown files, and `.github/workflows/build.yml`, which holds build steps) bumps the version as its last commit before the merge: `versionName` by that rule and `versionCode` +1. Docs-only and test-only pull requests do not. A pull request that changes the app or the build but not the APKs (a test or publication step in the workflow, a comment) takes the `no-release` label instead and keeps the version. Numbers are not reserved for open pull requests: each one takes the next number when it is merged. CI checks this on every pull request (`.github/check-version.sh`): a new number must be canonical (no leading zeros), greater than the base one, and come with its own `CHANGELOG.md` section. - Until 2.17 `v2` counted **2.xx** (+0.01 per pull request); 2.17 is followed by 2.17.1 or 2.18.0. `basic` keeps its 1.7.x line (1.07.1 is 1.7.1). - **`CHANGELOG.md`** is the change history: the version bump commit of a pull request that changes the app adds the version's section (`## — `, newest first) in the same pull request. - Development is continuous, so there is **no release per version** (#194). The one release, [`latest`](https://github.com/OpenIPC/decoder/releases/latest), holds the newest `v2` and `basic` builds and is updated in place by both (`.github/publish-latest.sh`, #229): each branch replaces only its own files; a `v2` build moves the `latest` tag to the commit it built and sets the title `Decoder `; the notes have one line per branch with its version and commit. Every **new version** (not every build) of `v2` and `basic` is posted to the OpenIPC Telegram channel, where the older builds can be found. Builds of other branches are only workflow artifacts of their runs (90 days).