Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .github/check-version.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,10 @@
# 2.xx versions before MAJOR.MINOR.PATCH stay valid until the next app
# change.
#
# CI runs it from .github/workflows/version.yml (#244), a workflow of its own
# that also re-runs on a label change; version.yml and publish-latest.sh are
# CI, not build.
#
# Usage: .github/check-version.sh [BASE] (default origin/v2; CI passes
# HEAD^1, the base side of the pull request's merge commit)
#
Expand Down
23 changes: 1 addition & 22 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@ 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:
Expand All @@ -26,26 +24,7 @@ permissions:
contents: read

jobs:
# 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'
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0

# The checkout is the pull request's merge commit: its first parent is the
# 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') }}
# The version check of pull requests is .github/workflows/version.yml (#244).

# Unit tests and lint; also runs for pull requests from forks (no secrets needed)
test:
Expand Down
41 changes: 41 additions & 0 deletions .github/workflows/version.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
# version.yml — the version check of pull requests to v2 (#230, #239, #244)
#
# A change to the app or its build (android/, build.yml) comes with a new
# versionName (MAJOR.MINOR.PATCH) and its CHANGELOG.md section, unless the
# no-release label says the APKs do not change. A workflow of its own:
# adding or removing a label re-runs this check, not the build. basic keeps
# its own workflow and version file (app/build.gradle).

name: Version

on:
pull_request:
branches: [v2]
# labeled / unlabeled: the check reads the no-release label
types: [opened, synchronize, reopened, labeled, unlabeled]

permissions:
contents: read

# a newer event of the same pull request cancels the older check
concurrency:
group: version-${{ github.ref }}
cancel-in-progress: true

jobs:
version:
name: Version bump
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0

# The checkout is the pull request's merge commit: its first parent is the
# 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') }}
2 changes: 1 addition & 1 deletion docs/testing.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 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.
- 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 to `v2` (`.github/check-version.sh` in the `version` workflow, `.github/workflows/version.yml`; adding or removing a label re-runs only this check, not the build): 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 (`## <version> — <date>`, 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 <version>`; the notes have one line per branch with its version and commit. The APK of every **new `v2` version** (not every build) is posted to the OpenIPC Telegram channel, where the older builds can be found; `basic` posts nothing there. Builds of other branches are only workflow artifacts of their runs (90 days).
Expand Down
Loading