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
62 changes: 61 additions & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -119,14 +119,74 @@ jobs:
tag_name: latest
files: ${{ steps.vars.outputs.name }}.apk

# v2: every version gets a release of its own (#157), at the commit that was built, with
# the APK and the merged PRs since the previous v2.* release. A push without a version
# bump (docs, CI) only updates "latest" above. Not marked Latest: the README links
# releases/tag/latest
- name: Versioned release
if: github.ref_name == 'v2'
Comment on lines +126 to +127

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remediation recommended

4. A failed latest upload skips versioning 🐞 Bug ☼ Reliability

Versioned release follows the Upload action with an if condition that does not override the
default success requirement. If publishing latest fails, the job skips versioned publication even
though the signed APK has already been built.
Agent Prompt
## Issue description
Failure of the preceding latest-release upload prevents an otherwise built APK from receiving its versioned release.
## Fix Focus Areas
- .github/workflows/build.yml[114-130]
## Recommended Fix
Make versioned publication independent of the latest upload, for example by giving it an appropriate status-aware condition or moving both publications into independent jobs.

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools

env:
GH_TOKEN: ${{ github.token }}
run: |
VER=$(sed -n 's/.*versionName "\(.*\)".*/\1/p' android/app/build.gradle)
TAG="v${VER}"
if [ -z "$VER" ]; then echo "No versionName found"; exit 1; fi
APK="decoder-v2-${VER}.apk"
cp decoder-v2.apk "$APK"
# An existing release is complete only with its APK (Qodo on #158)
has_apk() {
gh release view "$TAG" --json assets -q '.assets[].name' 2>/dev/null | grep -qx "$APK"
}
# Only the build of the tagged commit may add the missing APK (Qodo on #158)
repair_apk() {
TAGGED=$(gh api "repos/${{ github.repository }}/commits/$TAG" -q .sha)
if [ "$TAGGED" = "$(git rev-parse HEAD)" ]; then
gh release upload "$TAG" "$APK" --clobber
else
echo "::warning::$TAG has no $APK and points to ${TAGGED:0:7}, not this build"
fi
Comment on lines +146 to +147

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Action required

1. Incomplete releases can appear successful 🐞 Bug ≡ Correctness

repair_apk returns success after only printing a warning when the release tag points to a
different commit. If an existing release lacks its APK and the current build is not of its tagged
commit, the step exits successfully without uploading the missing asset.
Agent Prompt
## Issue description
An existing release without its APK is treated as successfully published when the current build cannot safely repair it.
## Fix Focus Areas
- .github/workflows/build.yml[140-155]
- .github/workflows/build.yml[169-175]
## Recommended Fix
Keep the commit check that prevents uploading an APK from the wrong build, but return a nonzero status when it prevents repair. Ensure both callers fail unless the release has its APK.

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools

}
if gh release view "$TAG" >/dev/null 2>&1; then
if has_apk; then
echo "Release $TAG exists: only latest was updated"
else
repair_apk
fi
exit 0
Comment thread
qodo-free-for-open-source-projects[bot] marked this conversation as resolved.
fi
# The previous version by number, not by date: a manual build of an older commit may
# publish after a newer one (Qodo on #158)
# A failed lookup fails the step rather than publishing first-release notes
TAGS=$(gh api --paginate "repos/${{ github.repository }}/releases?per_page=100" \
-q '.[].tag_name')
PREV=$(printf '%s\n' "$TAGS" | grep '^v2\.' | sed 's/^v//' | { cat; echo "$VER"; } \
| sort -V -u | grep -B1 -x "$VER" | grep -v -x "$VER" || true)
if [ -n "$PREV" ]; then
NOTES=(--generate-notes --notes-start-tag "v$PREV")
else
NOTES=(--notes "First release of the 2.xx line (v2 branch). Earlier changes: https://github.com/${{ github.repository }}/commits/v2")
fi
if ! gh release create "$TAG" "$APK" --target "$(git rev-parse HEAD)" \
--title "OpenIPC Decoder ${VER}" --latest=false "${NOTES[@]}"; then
Comment on lines +169 to +170

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remediation recommended

5. Pre-existing tags can get the wrong apk 🐞 Bug ≡ Correctness

gh release create supplies the built commit through --target but does not check whether the
version tag already exists. If that tag exists without a release and points to another commit,
release creation uses the existing tag while attaching the current build's APK; the tag-commit check
applies only to missing-asset repair.
Agent Prompt
## Issue description
A version tag that predates its release can point to a different commit from the APK attached during release creation.
## Fix Focus Areas
- .github/workflows/build.yml[149-170]
## Recommended Fix
Before creating a release, check whether its tag exists. If it does, require that it resolves to the built commit before attaching the APK; otherwise fail without publishing a mismatched asset.

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools

# Another build of the same version created it meanwhile, or the upload failed:
# the release must exist and carry the APK, else the step fails
gh release view "$TAG" >/dev/null
has_apk || repair_apk
fi

- name: Telegram
if: github.ref_name == 'basic' || github.ref_name == 'v2'
run: |
# basic keeps its Gradle files at the top level; read only the one that exists
# (a missing file would fail the step under pipefail, Qodo on #158)
GRADLE=android/app/build.gradle
[ -f "$GRADLE" ] || GRADLE=app/build.gradle
VER=$(sed -n 's/.*versionName "\(.*\)".*/\1/p' "$GRADLE" | head -1)
GIT_HASH=$(git rev-parse --short HEAD)
GIT_BRANCH="${{ github.ref_name }}"
TAG_NAME="${{ github.ref_type == 'tag' && github.ref_name || '' }}"
TIME=$(date -u '+%Y-%m-%d %H:%M:%S UTC')
TG_MSG="Commit: ${GIT_HASH}\nBranch: ${GIT_BRANCH}\nTag: ${TAG_NAME}\nTime: ${TIME}\n\n"
TG_MSG="Version: ${VER}\nCommit: ${GIT_HASH}\nBranch: ${GIT_BRANCH}\nTag: ${TAG_NAME}\nTime: ${TIME}\n\n"
TG_ICON="\xE2\x9C\x85 GitHub Actions"
TG_HEADER=$(echo -e ${TG_MSG}${TG_ICON})
TG_TOKEN=${{secrets.TELEGRAM_TOKEN_BOT_OPENIPC}}
Expand Down
1 change: 1 addition & 0 deletions LABORATORY.md
Original file line number Diff line number Diff line change
Expand Up @@ -205,6 +205,7 @@ $ADB shell getprop ro.product.model # AG-216
### Builds

- `v2` / `basic`: `gh release download latest -R OpenIPC/decoder -p decoder-v2.apk -p decoder.apk`
- A given 2.xx version: `gh release download v2.01 -R OpenIPC/decoder` (`decoder-v2-2.01.apk`). CI creates the release `v<versionName>` on the first v2 build of each version (#157).
- Branches: `build.yml` builds signed APKs only on **push** runs (not `pull_request`); artifact name is `decoder-<branch with / → ->`:
```sh
B=feat/rtsp-multicast
Expand Down
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ Ready-to-install builds are in the [**latest** release](https://github.com/OpenI
| `decoder-v2.apk` | **Current version**, recommended |
| `decoder.apk` | Legacy version from the `basic` branch |

Each 2.xx version also has a release of its own — [`v2.01`](https://github.com/OpenIPC/decoder/releases/tag/v2.01) and later, on the [releases page](https://github.com/OpenIPC/decoder/releases) — with that version's APK and the changes since the previous one.

A beta channel is available on [Google Play](https://play.google.com/apps/internaltest/4701231141824898735). To join it, send your e-mail through the [OpenIPC Telegram channels](https://openipc.org/our-channels).

## Features
Expand Down
2 changes: 2 additions & 0 deletions README.ru.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@
| `decoder-v2.apk` | **Текущая версия**, рекомендуется |
| `decoder.apk` | Старая версия из ветки `basic` |

У каждой версии 2.xx есть и свой релиз — [`v2.01`](https://github.com/OpenIPC/decoder/releases/tag/v2.01) и далее, на [странице релизов](https://github.com/OpenIPC/decoder/releases) — с APK этой версии и списком изменений после предыдущей.

Есть бета-канал в [Google Play](https://play.google.com/apps/internaltest/4701231141824898735). Чтобы попасть в него, пришлите свой e-mail через [Telegram-каналы OpenIPC](https://openipc.org/our-channels).

## Возможности
Expand Down
2 changes: 2 additions & 0 deletions README.zh-CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@
| `decoder-v2.apk` | **当前版本**,推荐使用 |
| `decoder.apk` | `basic` 分支的旧版本 |

每个 2.xx 版本另有独立的发布 — [`v2.01`](https://github.com/OpenIPC/decoder/releases/tag/v2.01) 及之后的版本,见[发布页面](https://github.com/OpenIPC/decoder/releases) — 包含该版本的 APK 以及相对上一版本的更改。

[Google Play](https://play.google.com/apps/internaltest/4701231141824898735) 上提供测试渠道。如需加入,请通过 [OpenIPC Telegram 频道](https://openipc.org/our-channels)发送您的电子邮箱。

## 功能
Expand Down
Loading