ci: support dev staging branch and pre-release tags in release workflow (#999)

Co-authored-by: M57 <hy4ri@users.noreply.github.com>
This commit is contained in:
M57andM57 authored and GitHub committed 2026-08-28 14:14:47 +03:00
1 parent 0cdccad855
commit 7bfb6d5c16
9 files changed
+32 -26

No files matched your search

+2 -2
View File
@@ -5,9 +5,9 @@ env:
on:
push:
branches: [main]
branches: [main, dev]
pull_request:
branches: [main]
branches: [main, dev]
workflow_dispatch:
permissions:
+2 -2
View File
@@ -2,9 +2,9 @@ name: "CodeQL Analysis"
on:
push:
branches: [ "main" ]
branches: [ "main", "dev" ]
pull_request:
branches: [ "main" ]
branches: [ "main", "dev" ]
schedule:
- cron: '30 3 * * 1' # Runs at 03:30 UTC every Monday
@@ -3,9 +3,9 @@ name: Merge Conflict Detector
on:
pull_request:
types: [opened, synchronize, reopened]
branches: [main]
branches: [main, dev]
push:
branches: [main]
branches: [main, dev]
# Cancel in-progress runs when a new event lands — protects the expensive
# bulk-check path. github.ref is stable per PR (refs/pull/N/merge) AND stable
@@ -125,19 +125,20 @@ jobs:
return;
}
// ── Bulk check all open PRs (push to main event) ───────────
// ── Bulk check all open PRs (push to main/dev event) ───────────
// GitHub usually recomputes mergeable for every open PR at once after a
// push, so most hit the retry loop simultaneously. Batch a few at a time
// with Promise.all to bound wall-clock without hammering the API.
if (context.eventName === 'push') {
const targetBranch = context.ref.replace('refs/heads/', '');
const { data: prs } = await github.rest.pulls.list({
owner: context.repo.owner,
repo: context.repo.repo,
state: 'open',
base: 'main',
base: targetBranch,
per_page: 100,
});
core.info(`Checking ${prs.length} open PR(s) base on main...`);
core.info(`Checking ${prs.length} open PR(s) based on ${targetBranch}...`);
const CHUNK = 5;
for (let i = 0; i < prs.length; i += CHUNK) {
const batch = prs.slice(i, i + CHUNK);
+1 -1
View File
@@ -3,7 +3,7 @@ name: PR Auto-Labeler
on:
pull_request_target:
types: [opened, synchronize, reopened]
branches: [main]
branches: [main, dev]
permissions:
contents: read
+11 -4
View File
@@ -54,11 +54,18 @@ jobs:
# Strip leading 'v' for versionName
VERSION="${TAG#v}"
echo "version=$VERSION" >> "$GITHUB_OUTPUT"
# versionCode: strip dots from version, pad to keep sortable
CODE=$(echo "$VERSION" | tr -d '.' | sed 's/^0*//')
# versionCode: strip pre-release suffixes (e.g. 1.25.0-rc1 -> 1.25.0) and dots
BASE_VERSION="${VERSION%%-*}"
CODE=$(echo "$BASE_VERSION" | tr -d '.' | sed 's/^0*//')
[ -z "$CODE" ] && CODE=0
echo "code=$CODE" >> "$GITHUB_OUTPUT"
echo "Release: tag=$TAG version=$VERSION code=$CODE"
if [[ "$VERSION" == *"-"* ]]; then
PRERELEASE="true"
else
PRERELEASE="false"
fi
echo "prerelease=$PRERELEASE" >> "$GITHUB_OUTPUT"
echo "Release: tag=$TAG version=$VERSION code=$CODE prerelease=$PRERELEASE"
- name: Decode release keystore
env:
@@ -108,6 +115,6 @@ jobs:
files: |
release/hermes-mobile-${{ steps.version.outputs.tag }}.apk
release/version.txt
prerelease: false
prerelease: ${{ steps.version.outputs.prerelease == 'true' }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}