Add files via upload
This commit is contained in:
@@ -0,0 +1,74 @@
|
||||
name: Build-new
|
||||
|
||||
on:
|
||||
workflow_dispatch:
|
||||
|
||||
jobs:
|
||||
Android:
|
||||
name: Android
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Check out git repository
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Setup Env
|
||||
uses: ./.github/actions/setup
|
||||
|
||||
- name: Configure TVBoxOSC Signing
|
||||
run: |
|
||||
cd android
|
||||
cat <<'EOF' >> gradle.properties
|
||||
FONGMIBOX_STORE_FILE=../app/TVBoxOSC.jks
|
||||
FONGMIBOX_KEY_ALIAS=TVBoxOSC
|
||||
FONGMIBOX_STORE_PASSWORD=TVBoxOSC
|
||||
FONGMIBOX_KEY_PASSWORD=TVBoxOSC
|
||||
EOF
|
||||
|
||||
- name: Build Packages
|
||||
run: |
|
||||
cd android
|
||||
chmod +x ./gradlew
|
||||
./gradlew clean assembleRelease --parallel --daemon --warning-mode all
|
||||
|
||||
- name: Upload Artifact
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: android-build
|
||||
# 找到生成的 apk 文件并上传
|
||||
path: android/app/build/outputs/apk/release/*.apk
|
||||
retention-days: 1
|
||||
|
||||
Release:
|
||||
name: Release
|
||||
runs-on: ubuntu-latest
|
||||
needs: [Android]
|
||||
steps:
|
||||
- name: Check out git repository
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Download Artifacts
|
||||
uses: actions/download-artifact@v4
|
||||
with:
|
||||
name: android-build
|
||||
path: ./artifacts
|
||||
|
||||
# 彻底删除旧的 Release 和 Tag,确保只保留最后一次
|
||||
- name: Delete Old Release
|
||||
uses: dev-drprasad/delete-tag-and-release@v1.1
|
||||
with:
|
||||
delete_release: true
|
||||
tag_name: latest-build
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
|
||||
- name: Release
|
||||
uses: softprops/action-gh-release@v2
|
||||
with:
|
||||
tag_name: latest-build
|
||||
name: "Latest Build"
|
||||
body: "Last Build: ${{ github.event.head_commit.message }}"
|
||||
prerelease: false
|
||||
draft: false
|
||||
files: ./artifacts/*.apk
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
Reference in New Issue
Block a user