forked from upstream-mirrors/quik
Automate CI/CD, document fork features, and format messages
This commit is contained in:
@@ -0,0 +1,69 @@
|
||||
name: Build and Release APK
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [ main ]
|
||||
tags: [ 'v*' ]
|
||||
pull_request:
|
||||
branches: [ main ]
|
||||
|
||||
jobs:
|
||||
build:
|
||||
name: Build APK
|
||||
runs-on: ubuntu-latest
|
||||
container:
|
||||
image: mingc/android-build-box:latest
|
||||
steps:
|
||||
- name: Checkout Repository
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Restore Gradle Cache
|
||||
uses: actions/cache@v3
|
||||
with:
|
||||
path: |
|
||||
~/.gradle/caches
|
||||
~/.gradle/wrapper
|
||||
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }}
|
||||
restore-keys: |
|
||||
${{ runner.os }}-gradle-
|
||||
|
||||
- name: Grant execute permission for gradlew
|
||||
run: chmod +x gradlew
|
||||
|
||||
- name: Build Debug APK
|
||||
run: ./gradlew assembleDebug
|
||||
|
||||
- name: Build Release APK
|
||||
run: ./gradlew assembleRelease
|
||||
|
||||
- name: Upload Debug APK Artifact
|
||||
uses: actions/upload-artifact@v3
|
||||
with:
|
||||
name: Quik-Debug-APK
|
||||
path: presentation/build/outputs/apk/debug/*.apk
|
||||
|
||||
- name: Upload Release APK Artifact
|
||||
uses: actions/upload-artifact@v3
|
||||
with:
|
||||
name: Quik-Release-APK
|
||||
path: presentation/build/outputs/apk/release/*.apk
|
||||
|
||||
release:
|
||||
name: Create Gitea Release
|
||||
needs: build
|
||||
if: startsWith(github.ref, 'refs/tags/')
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout Repository
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Download Artifacts
|
||||
uses: actions/download-artifact@v3
|
||||
|
||||
- name: Create Release
|
||||
uses: ncipollo/release-action@v1
|
||||
with:
|
||||
artifacts: "Quik-Debug-APK/*.apk,Quik-Release-APK/*.apk"
|
||||
token: ${{ secrets.GITHUB_TOKEN }}
|
||||
name: Release ${{ github.ref_name }}
|
||||
body: "Automated release of Quik Fork with Remotrix integration."
|
||||
@@ -0,0 +1,41 @@
|
||||
name: Sync Upstream Quik
|
||||
|
||||
on:
|
||||
schedule:
|
||||
- cron: '0 2 * * 1' # Runs every Monday at 02:00
|
||||
workflow_dispatch:
|
||||
|
||||
jobs:
|
||||
sync:
|
||||
name: Sync with Upstream
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout Repository
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
fetch-depth: 0
|
||||
token: ${{ secrets.GITHUB_TOKEN }}
|
||||
|
||||
- name: Configure Git
|
||||
run: |
|
||||
git config user.name "Gitea Automation"
|
||||
git config user.email "actions@gitea.local"
|
||||
|
||||
- name: Fetch and Merge Upstream
|
||||
run: |
|
||||
git remote add upstream https://gitea.labus.uk/upstream-mirrors/quik.git
|
||||
git fetch upstream
|
||||
# Try to merge upstream main into our main branch.
|
||||
# If it fails, the step exits with a non-zero code.
|
||||
git merge upstream/main --no-edit
|
||||
git push origin main
|
||||
|
||||
- name: Notify on Failure
|
||||
if: failure()
|
||||
run: |
|
||||
echo "::error::Merge conflict detected or upstream sync failed! Please resolve manually."
|
||||
# Automatically create an issue via Gitea API to notify the owner
|
||||
curl -X POST "${{ github.api_url }}/repos/${{ github.repository }}/issues" \
|
||||
-H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \
|
||||
-H "Content-Type: application/json" \
|
||||
-d '{"title": "⚠️ Upstream Sync Failed - Merge Conflict", "body": "The scheduled upstream sync with `quik` encountered a merge conflict or error. Please resolve it manually by pulling from upstream and fixing the conflicts."}'
|
||||
Reference in New Issue
Block a user