mirror of
https://github.com/SideStore/SideStore.git
synced 2026-02-28 07:57:38 +01:00
ci: added back the nightly schedule checking for new commits and only then build
This commit is contained in:
30
.github/workflows/alpha.yml
vendored
30
.github/workflows/alpha.yml
vendored
@@ -23,6 +23,13 @@ jobs:
|
|||||||
submodules: recursive
|
submodules: recursive
|
||||||
fetch-depth: 0
|
fetch-depth: 0
|
||||||
|
|
||||||
|
- run: |
|
||||||
|
LAST_SUCCESSFUL_COMMIT=$(python3 scripts/ci/workflow.py last-successful-commit \
|
||||||
|
"${{ github.workflow }}" "${{ env.CHANNEL }}" || echo "")
|
||||||
|
echo "LAST_SUCCESSFUL_COMMIT=$LAST_SUCCESSFUL_COMMIT" | tee -a $GITHUB_ENV
|
||||||
|
env:
|
||||||
|
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
|
||||||
- uses: actions/cache@v4
|
- uses: actions/cache@v4
|
||||||
with:
|
with:
|
||||||
path: |
|
path: |
|
||||||
@@ -99,7 +106,9 @@ jobs:
|
|||||||
python3 scripts/ci/workflow.py clean-spm-cache
|
python3 scripts/ci/workflow.py clean-spm-cache
|
||||||
|
|
||||||
- name: Boot simulator (async)
|
- name: Boot simulator (async)
|
||||||
if: ${{ vars.ENABLE_TESTS == '1' && vars.ENABLE_TESTS_RUN == '1' }}
|
if: >
|
||||||
|
vars.ENABLE_TESTS == '1' &&
|
||||||
|
vars.ENABLE_TESTS_RUN == '1'
|
||||||
run: |
|
run: |
|
||||||
mkdir -p build/logs
|
mkdir -p build/logs
|
||||||
python3 scripts/ci/workflow.py boot-sim-async "iPhone 17 Pro"
|
python3 scripts/ci/workflow.py boot-sim-async "iPhone 17 Pro"
|
||||||
@@ -116,7 +125,9 @@ jobs:
|
|||||||
|
|
||||||
- name: Tests Build
|
- name: Tests Build
|
||||||
id: test-build
|
id: test-build
|
||||||
if: ${{ vars.ENABLE_TESTS == '1' && vars.ENABLE_TESTS_BUILD == '1' }}
|
if: >
|
||||||
|
vars.ENABLE_TESTS == '1' &&
|
||||||
|
vars.ENABLE_TESTS_BUILD == '1'
|
||||||
env:
|
env:
|
||||||
BUILD_LOG_ZIP_PASSWORD: ${{ secrets.BUILD_LOG_ZIP_PASSWORD }}
|
BUILD_LOG_ZIP_PASSWORD: ${{ secrets.BUILD_LOG_ZIP_PASSWORD }}
|
||||||
run: |
|
run: |
|
||||||
@@ -135,7 +146,9 @@ jobs:
|
|||||||
|
|
||||||
- name: Tests Run
|
- name: Tests Run
|
||||||
id: test-run
|
id: test-run
|
||||||
if: ${{ vars.ENABLE_TESTS == '1' && vars.ENABLE_TESTS_RUN == '1' }}
|
if: >
|
||||||
|
vars.ENABLE_TESTS == '1' &&
|
||||||
|
vars.ENABLE_TESTS_RUN == '1'
|
||||||
env:
|
env:
|
||||||
BUILD_LOG_ZIP_PASSWORD: ${{ secrets.BUILD_LOG_ZIP_PASSWORD }}
|
BUILD_LOG_ZIP_PASSWORD: ${{ secrets.BUILD_LOG_ZIP_PASSWORD }}
|
||||||
run: |
|
run: |
|
||||||
@@ -152,13 +165,17 @@ jobs:
|
|||||||
path: encrypted-build-logs.zip
|
path: encrypted-build-logs.zip
|
||||||
|
|
||||||
- uses: actions/upload-artifact@v4
|
- uses: actions/upload-artifact@v4
|
||||||
if: ${{ vars.ENABLE_TESTS == '1' && vars.ENABLE_TESTS_BUILD == '1' }}
|
if: >
|
||||||
|
vars.ENABLE_TESTS == '1' &&
|
||||||
|
vars.ENABLE_TESTS_BUILD == '1'
|
||||||
with:
|
with:
|
||||||
name: encrypted-tests-build-logs-${{ env.SHORT_COMMIT }}.zip
|
name: encrypted-tests-build-logs-${{ env.SHORT_COMMIT }}.zip
|
||||||
path: encrypted-tests-build-logs.zip
|
path: encrypted-tests-build-logs.zip
|
||||||
|
|
||||||
- uses: actions/upload-artifact@v4
|
- uses: actions/upload-artifact@v4
|
||||||
if: ${{ vars.ENABLE_TESTS == '1' && vars.ENABLE_TESTS_RUN == '1' }}
|
if: >
|
||||||
|
vars.ENABLE_TESTS == '1' &&
|
||||||
|
vars.ENABLE_TESTS_RUN == '1'
|
||||||
with:
|
with:
|
||||||
name: encrypted-tests-run-logs-${{ env.SHORT_COMMIT }}.zip
|
name: encrypted-tests-run-logs-${{ env.SHORT_COMMIT }}.zip
|
||||||
path: encrypted-tests-run-logs.zip
|
path: encrypted-tests-run-logs.zip
|
||||||
@@ -192,9 +209,6 @@ jobs:
|
|||||||
SOURCE_JSON="_includes/source.json"
|
SOURCE_JSON="_includes/source.json"
|
||||||
IPA_NAME="$PRODUCT_NAME.ipa"
|
IPA_NAME="$PRODUCT_NAME.ipa"
|
||||||
|
|
||||||
LAST_SUCCESSFUL_COMMIT=$(python3 scripts/ci/workflow.py last-successful-commit \
|
|
||||||
"${{ github.workflow }}" "$CHANNEL")
|
|
||||||
|
|
||||||
python3 scripts/ci/workflow.py deploy \
|
python3 scripts/ci/workflow.py deploy \
|
||||||
SideStore/apps-v2.json \
|
SideStore/apps-v2.json \
|
||||||
"$SOURCE_JSON" \
|
"$SOURCE_JSON" \
|
||||||
|
|||||||
76
.github/workflows/nightly.yml
vendored
76
.github/workflows/nightly.yml
vendored
@@ -25,7 +25,34 @@ jobs:
|
|||||||
submodules: recursive
|
submodules: recursive
|
||||||
fetch-depth: 0
|
fetch-depth: 0
|
||||||
|
|
||||||
|
- run: |
|
||||||
|
LAST_SUCCESSFUL_COMMIT=$(python3 scripts/ci/workflow.py last-successful-commit \
|
||||||
|
"${{ github.workflow }}" "${{ env.CHANNEL }}" || echo "")
|
||||||
|
echo "LAST_SUCCESSFUL_COMMIT=$LAST_SUCCESSFUL_COMMIT" | tee -a $GITHUB_ENV
|
||||||
|
env:
|
||||||
|
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
|
||||||
|
- name: Check for new changes (on schedule)
|
||||||
|
id: check_changes
|
||||||
|
if: github.event_name == 'schedule'
|
||||||
|
run: |
|
||||||
|
NEW_COMMITS=$(python3 scripts/ci/workflow.py count-new-commits "$LAST_SUCCESSFUL_COMMIT")
|
||||||
|
SHOULD_BUILD=$([ "${NEW_COMMITS:-0}" -ge 1 ] && echo true || echo false)
|
||||||
|
echo "should_build=$SHOULD_BUILD" >> $GITHUB_OUTPUT
|
||||||
|
echo "NEW_COMMITS=$NEW_COMMITS" | tee -a $GITHUB_ENV
|
||||||
|
|
||||||
|
- name: Should Skip Building (on schedule)
|
||||||
|
id: build_gate
|
||||||
|
run: |
|
||||||
|
SHOULD_SKIP=$(
|
||||||
|
{ [ "${{ github.event_name }}" = "schedule" ] && \
|
||||||
|
[ "${{ steps.check_changes.outputs.should_build }}" != "true" ]; \
|
||||||
|
} && echo true || echo false
|
||||||
|
)
|
||||||
|
echo "should_skip=$SHOULD_SKIP" >> $GITHUB_OUTPUT
|
||||||
|
|
||||||
- uses: actions/cache@v4
|
- uses: actions/cache@v4
|
||||||
|
if: steps.build_gate.outputs.should_skip != 'true'
|
||||||
with:
|
with:
|
||||||
path: |
|
path: |
|
||||||
/opt/homebrew/Cellar
|
/opt/homebrew/Cellar
|
||||||
@@ -37,11 +64,13 @@ jobs:
|
|||||||
- run: |
|
- run: |
|
||||||
brew list ldid >/dev/null 2>&1 || brew install ldid
|
brew list ldid >/dev/null 2>&1 || brew install ldid
|
||||||
brew list xcbeautify >/dev/null 2>&1 || brew install xcbeautify
|
brew list xcbeautify >/dev/null 2>&1 || brew install xcbeautify
|
||||||
|
if: steps.build_gate.outputs.should_skip != 'true'
|
||||||
|
|
||||||
# --------------------------------------------------
|
# --------------------------------------------------
|
||||||
# runtime env setup
|
# runtime env setup
|
||||||
# --------------------------------------------------
|
# --------------------------------------------------
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
|
if: steps.build_gate.outputs.should_skip != 'true'
|
||||||
with:
|
with:
|
||||||
repository: "SideStore/beta-build-num"
|
repository: "SideStore/beta-build-num"
|
||||||
ref: ${{ env.CHANNEL }}
|
ref: ${{ env.CHANNEL }}
|
||||||
@@ -50,6 +79,7 @@ jobs:
|
|||||||
fetch-depth: 1
|
fetch-depth: 1
|
||||||
|
|
||||||
- name: Setup Env
|
- name: Setup Env
|
||||||
|
if: steps.build_gate.outputs.should_skip != 'true'
|
||||||
run: |
|
run: |
|
||||||
BUILD_NUM=$(python3 scripts/ci/workflow.py reserve_build_number 'Dependencies/beta-build-num')
|
BUILD_NUM=$(python3 scripts/ci/workflow.py reserve_build_number 'Dependencies/beta-build-num')
|
||||||
MARKETING_VERSION=$(python3 scripts/ci/workflow.py get-marketing-version)
|
MARKETING_VERSION=$(python3 scripts/ci/workflow.py get-marketing-version)
|
||||||
@@ -68,11 +98,13 @@ jobs:
|
|||||||
echo "MARKETING_VERSION=$QUALIFIED_VERSION" | tee -a $GITHUB_ENV
|
echo "MARKETING_VERSION=$QUALIFIED_VERSION" | tee -a $GITHUB_ENV
|
||||||
|
|
||||||
- name: Setup Xcode
|
- name: Setup Xcode
|
||||||
|
if: steps.build_gate.outputs.should_skip != 'true'
|
||||||
uses: maxim-lobanov/setup-xcode@v1.6.0
|
uses: maxim-lobanov/setup-xcode@v1.6.0
|
||||||
with:
|
with:
|
||||||
xcode-version: "26.2"
|
xcode-version: "26.2"
|
||||||
|
|
||||||
- name: Restore Cache (exact)
|
- name: Restore Cache (exact)
|
||||||
|
if: steps.build_gate.outputs.should_skip != 'true'
|
||||||
id: xcode-cache-exact
|
id: xcode-cache-exact
|
||||||
uses: actions/cache/restore@v3
|
uses: actions/cache/restore@v3
|
||||||
with:
|
with:
|
||||||
@@ -82,7 +114,9 @@ jobs:
|
|||||||
key: xcode-build-cache-${{ github.ref_name }}-${{ github.sha }}
|
key: xcode-build-cache-${{ github.ref_name }}-${{ github.sha }}
|
||||||
|
|
||||||
- name: Restore Cache (last)
|
- name: Restore Cache (last)
|
||||||
if: steps.xcode-cache-exact.outputs.cache-hit != 'true'
|
if: >
|
||||||
|
steps.build_gate.outputs.should_skip != 'true' &&
|
||||||
|
steps.xcode-cache-exact.outputs.cache-hit != 'true'
|
||||||
id: xcode-cache-fallback
|
id: xcode-cache-fallback
|
||||||
uses: actions/cache/restore@v3
|
uses: actions/cache/restore@v3
|
||||||
with:
|
with:
|
||||||
@@ -95,19 +129,23 @@ jobs:
|
|||||||
# build and test
|
# build and test
|
||||||
# --------------------------------------------------
|
# --------------------------------------------------
|
||||||
- name: Clean
|
- name: Clean
|
||||||
if: contains(github.event.head_commit.message, '[--clean-build]')
|
if: steps.build_gate.outputs.should_skip != 'true' && contains(github.event.head_commit.message, '[--clean-build]')
|
||||||
run: |
|
run: |
|
||||||
python3 scripts/ci/workflow.py clean
|
python3 scripts/ci/workflow.py clean
|
||||||
python3 scripts/ci/workflow.py clean-derived-data
|
python3 scripts/ci/workflow.py clean-derived-data
|
||||||
python3 scripts/ci/workflow.py clean-spm-cache
|
python3 scripts/ci/workflow.py clean-spm-cache
|
||||||
|
|
||||||
- name: Boot simulator (async)
|
- name: Boot simulator (async)
|
||||||
if: ${{ vars.ENABLE_TESTS == '1' && vars.ENABLE_TESTS_RUN == '1' }}
|
if: >
|
||||||
|
steps.build_gate.outputs.should_skip != 'true' &&
|
||||||
|
vars.ENABLE_TESTS == '1' &&
|
||||||
|
vars.ENABLE_TESTS_RUN == '1'
|
||||||
run: |
|
run: |
|
||||||
mkdir -p build/logs
|
mkdir -p build/logs
|
||||||
python3 scripts/ci/workflow.py boot-sim-async "iPhone 17 Pro"
|
python3 scripts/ci/workflow.py boot-sim-async "iPhone 17 Pro"
|
||||||
|
|
||||||
- name: Build
|
- name: Build
|
||||||
|
if: steps.build_gate.outputs.should_skip != 'true'
|
||||||
id: build
|
id: build
|
||||||
env:
|
env:
|
||||||
BUILD_LOG_ZIP_PASSWORD: ${{ secrets.BUILD_LOG_ZIP_PASSWORD }}
|
BUILD_LOG_ZIP_PASSWORD: ${{ secrets.BUILD_LOG_ZIP_PASSWORD }}
|
||||||
@@ -118,8 +156,11 @@ jobs:
|
|||||||
exit $STATUS
|
exit $STATUS
|
||||||
|
|
||||||
- name: Tests Build
|
- name: Tests Build
|
||||||
|
if: >
|
||||||
|
steps.build_gate.outputs.should_skip != 'true' &&
|
||||||
|
vars.ENABLE_TESTS == '1' &&
|
||||||
|
vars.ENABLE_TESTS_BUILD == '1'
|
||||||
id: test-build
|
id: test-build
|
||||||
if: ${{ vars.ENABLE_TESTS == '1' && vars.ENABLE_TESTS_BUILD == '1' }}
|
|
||||||
env:
|
env:
|
||||||
BUILD_LOG_ZIP_PASSWORD: ${{ secrets.BUILD_LOG_ZIP_PASSWORD }}
|
BUILD_LOG_ZIP_PASSWORD: ${{ secrets.BUILD_LOG_ZIP_PASSWORD }}
|
||||||
run: |
|
run: |
|
||||||
@@ -128,7 +169,9 @@ jobs:
|
|||||||
exit $STATUS
|
exit $STATUS
|
||||||
|
|
||||||
- name: Save Cache
|
- name: Save Cache
|
||||||
if: ${{ steps.xcode-cache-fallback.outputs.cache-hit != 'true' }}
|
if: >
|
||||||
|
steps.build_gate.outputs.should_skip != 'true' &&
|
||||||
|
steps.xcode-cache-fallback.outputs.cache-hit != 'true'
|
||||||
uses: actions/cache/save@v3
|
uses: actions/cache/save@v3
|
||||||
with:
|
with:
|
||||||
path: |
|
path: |
|
||||||
@@ -137,8 +180,11 @@ jobs:
|
|||||||
key: xcode-build-cache-${{ github.ref_name }}-${{ github.sha }}
|
key: xcode-build-cache-${{ github.ref_name }}-${{ github.sha }}
|
||||||
|
|
||||||
- name: Tests Run
|
- name: Tests Run
|
||||||
|
if: >
|
||||||
|
steps.build_gate.outputs.should_skip != 'true' &&
|
||||||
|
vars.ENABLE_TESTS == '1' &&
|
||||||
|
vars.ENABLE_TESTS_RUN == '1'
|
||||||
id: test-run
|
id: test-run
|
||||||
if: ${{ vars.ENABLE_TESTS == '1' && vars.ENABLE_TESTS_RUN == '1' }}
|
|
||||||
env:
|
env:
|
||||||
BUILD_LOG_ZIP_PASSWORD: ${{ secrets.BUILD_LOG_ZIP_PASSWORD }}
|
BUILD_LOG_ZIP_PASSWORD: ${{ secrets.BUILD_LOG_ZIP_PASSWORD }}
|
||||||
run: |
|
run: |
|
||||||
@@ -150,32 +196,42 @@ jobs:
|
|||||||
# artifacts
|
# artifacts
|
||||||
# --------------------------------------------------
|
# --------------------------------------------------
|
||||||
- uses: actions/upload-artifact@v4
|
- uses: actions/upload-artifact@v4
|
||||||
|
if: steps.build_gate.outputs.should_skip != 'true'
|
||||||
with:
|
with:
|
||||||
name: encrypted-build-logs-${{ env.MARKETING_VERSION }}.zip
|
name: encrypted-build-logs-${{ env.MARKETING_VERSION }}.zip
|
||||||
path: encrypted-build-logs.zip
|
path: encrypted-build-logs.zip
|
||||||
|
|
||||||
- uses: actions/upload-artifact@v4
|
- uses: actions/upload-artifact@v4
|
||||||
if: ${{ vars.ENABLE_TESTS == '1' && vars.ENABLE_TESTS_BUILD == '1' }}
|
if: >
|
||||||
|
steps.build_gate.outputs.should_skip != 'true' &&
|
||||||
|
vars.ENABLE_TESTS == '1' &&
|
||||||
|
vars.ENABLE_TESTS_BUILD == '1'
|
||||||
with:
|
with:
|
||||||
name: encrypted-tests-build-logs-${{ env.SHORT_COMMIT }}.zip
|
name: encrypted-tests-build-logs-${{ env.SHORT_COMMIT }}.zip
|
||||||
path: encrypted-tests-build-logs.zip
|
path: encrypted-tests-build-logs.zip
|
||||||
|
|
||||||
- uses: actions/upload-artifact@v4
|
- uses: actions/upload-artifact@v4
|
||||||
if: ${{ vars.ENABLE_TESTS == '1' && vars.ENABLE_TESTS_RUN == '1' }}
|
if: >
|
||||||
|
steps.build_gate.outputs.should_skip != 'true' &&
|
||||||
|
vars.ENABLE_TESTS == '1' &&
|
||||||
|
vars.ENABLE_TESTS_RUN == '1'
|
||||||
with:
|
with:
|
||||||
name: encrypted-tests-run-logs-${{ env.SHORT_COMMIT }}.zip
|
name: encrypted-tests-run-logs-${{ env.SHORT_COMMIT }}.zip
|
||||||
path: encrypted-tests-run-logs.zip
|
path: encrypted-tests-run-logs.zip
|
||||||
|
|
||||||
- uses: actions/upload-artifact@v4
|
- uses: actions/upload-artifact@v4
|
||||||
|
if: steps.build_gate.outputs.should_skip != 'true'
|
||||||
with:
|
with:
|
||||||
name: SideStore-${{ env.MARKETING_VERSION }}.ipa
|
name: SideStore-${{ env.MARKETING_VERSION }}.ipa
|
||||||
path: SideStore.ipa
|
path: SideStore.ipa
|
||||||
- uses: actions/upload-artifact@v4
|
- uses: actions/upload-artifact@v4
|
||||||
|
if: steps.build_gate.outputs.should_skip != 'true'
|
||||||
with:
|
with:
|
||||||
name: SideStore-${{ env.MARKETING_VERSION }}-dSYMs.zip
|
name: SideStore-${{ env.MARKETING_VERSION }}-dSYMs.zip
|
||||||
path: SideStore.dSYMs.zip
|
path: SideStore.dSYMs.zip
|
||||||
|
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
|
if: steps.build_gate.outputs.should_skip != 'true'
|
||||||
with:
|
with:
|
||||||
repository: "SideStore/apps-v2.json"
|
repository: "SideStore/apps-v2.json"
|
||||||
ref: "main"
|
ref: "main"
|
||||||
@@ -186,6 +242,7 @@ jobs:
|
|||||||
# deploy
|
# deploy
|
||||||
# --------------------------------------------------
|
# --------------------------------------------------
|
||||||
- name: Deploy
|
- name: Deploy
|
||||||
|
if: steps.build_gate.outputs.should_skip != 'true'
|
||||||
env:
|
env:
|
||||||
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
run: |
|
run: |
|
||||||
@@ -195,9 +252,6 @@ jobs:
|
|||||||
SOURCE_JSON="_includes/source.json"
|
SOURCE_JSON="_includes/source.json"
|
||||||
IPA_NAME="$PRODUCT_NAME.ipa"
|
IPA_NAME="$PRODUCT_NAME.ipa"
|
||||||
|
|
||||||
LAST_SUCCESSFUL_COMMIT=$(python3 scripts/ci/workflow.py last-successful-commit \
|
|
||||||
"${{ github.workflow }}" "$CHANNEL")
|
|
||||||
|
|
||||||
python3 scripts/ci/workflow.py deploy \
|
python3 scripts/ci/workflow.py deploy \
|
||||||
SideStore/apps-v2.json \
|
SideStore/apps-v2.json \
|
||||||
"$SOURCE_JSON" \
|
"$SOURCE_JSON" \
|
||||||
|
|||||||
@@ -57,6 +57,21 @@ def getenv(name, default=""):
|
|||||||
def short_commit():
|
def short_commit():
|
||||||
return runAndGet("git rev-parse --short HEAD")
|
return runAndGet("git rev-parse --short HEAD")
|
||||||
|
|
||||||
|
def count_new_commits(last_commit):
|
||||||
|
if not last_commit or not last_commit.strip():
|
||||||
|
return 0
|
||||||
|
|
||||||
|
try:
|
||||||
|
total = int(runAndGet("git rev-list --count HEAD"))
|
||||||
|
if total == 1:
|
||||||
|
head = runAndGet("git rev-parse HEAD")
|
||||||
|
return 1 if head != last_commit else 0
|
||||||
|
|
||||||
|
out = runAndGet(f"git rev-list --count {last_commit}..HEAD")
|
||||||
|
return int(out)
|
||||||
|
except Exception:
|
||||||
|
return 0
|
||||||
|
|
||||||
# ----------------------------------------------------------
|
# ----------------------------------------------------------
|
||||||
# BUILD NUMBER RESERVATION
|
# BUILD NUMBER RESERVATION
|
||||||
# ----------------------------------------------------------
|
# ----------------------------------------------------------
|
||||||
@@ -464,6 +479,7 @@ COMMANDS = {
|
|||||||
# SHARED
|
# SHARED
|
||||||
# ----------------------------------------------------------
|
# ----------------------------------------------------------
|
||||||
"commit-id" : (short_commit, 0, ""),
|
"commit-id" : (short_commit, 0, ""),
|
||||||
|
"count-new-commits" : (count_new_commits, 1, "<last_successful_commit>"),
|
||||||
|
|
||||||
# ----------------------------------------------------------
|
# ----------------------------------------------------------
|
||||||
# PROJECT INFO
|
# PROJECT INFO
|
||||||
|
|||||||
Reference in New Issue
Block a user