205 lines
7.1 KiB
YAML
205 lines
7.1 KiB
YAML
name: Build111
|
|
|
|
on:
|
|
# push:
|
|
# branches: [ "main" ]
|
|
# pull_request:
|
|
# branches: [ "main" ]
|
|
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
|
|
ls -l app/TVBoxOSC.jks # 确认 keystore 存在
|
|
|
|
# 只写入属性即可,build.gradle 会自动识别并优先使用
|
|
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
|
|
|
|
# Push tag to GitHub if package.json version's tag is not tagged
|
|
- name: Get package version
|
|
run: |
|
|
PACKAGE_VERSION=$(node -p "require('./package.json').version")
|
|
echo "PACKAGE_VERSION=$PACKAGE_VERSION" >> $GITHUB_ENV
|
|
|
|
- name: Create git tag
|
|
uses: pkgdeps/git-tag-action@v3
|
|
with:
|
|
github_token: ${{ secrets.GITHUB_TOKEN }}
|
|
github_repo: ${{ github.repository }}
|
|
version: ${{ env.PACKAGE_VERSION }}
|
|
git_commit_sha: ${{ github.sha }}
|
|
git_tag_prefix: "v"
|
|
|
|
- name: Generate file MD5
|
|
run: |
|
|
cd android/app/build/outputs/apk/release
|
|
md5sum *.apk
|
|
|
|
- name: Upload Artifact
|
|
uses: ./.github/actions/upload-artifact
|
|
env:
|
|
PACKAGE_VERSION: ${{ env.PACKAGE_VERSION }}
|
|
|
|
# Android_SL:
|
|
# name: Android_SL
|
|
# runs-on: ubuntu-latest
|
|
# steps:
|
|
# - name: Check out git repository
|
|
# uses: actions/checkout@v4
|
|
# with:
|
|
# ref: statusbar_lyric
|
|
|
|
# - name: Setup Env
|
|
# uses: ./.github/actions/setup
|
|
|
|
# - name: Build Packages
|
|
# shell: bash
|
|
# run: |
|
|
# cd android
|
|
# echo ${{ secrets.KEYSTORE_STORE_FILE_BASE64 }} | base64 --decode > app/${{ secrets.KEYSTORE_STORE_FILE }}
|
|
# ./gradlew assembleRelease -PMYAPP_UPLOAD_STORE_FILE='${{ secrets.KEYSTORE_STORE_FILE }}' -PMYAPP_UPLOAD_KEY_ALIAS='${{ secrets.KEYSTORE_KEY_ALIAS }}' -PMYAPP_UPLOAD_STORE_PASSWORD='${{ secrets.KEYSTORE_PASSWORD }}' -PMYAPP_UPLOAD_KEY_PASSWORD='${{ secrets.KEYSTORE_KEY_PASSWORD }}'
|
|
# rm -f app/${{ secrets.KEYSTORE_STORE_FILE }}
|
|
|
|
# # Push tag to GitHub if package.json version's tag is not tagged
|
|
# - name: Get package version
|
|
# run: |
|
|
# node -p -e '`PACKAGE_VERSION=${require("./package.json").version}`' >> $GITHUB_ENV
|
|
# echo "COMMIT_SHA=$(git show -s --format=%H)" >> $GITHUB_ENV
|
|
|
|
# - name: Create git tag
|
|
# uses: pkgdeps/git-tag-action@v3
|
|
# with:
|
|
# github_token: ${{ secrets.GITHUB_TOKEN }}
|
|
# github_repo: ${{ github.repository }}
|
|
# version: ${{ env.PACKAGE_VERSION }}
|
|
# git_commit_sha: ${{ env.COMMIT_SHA }}
|
|
# git_tag_prefix: "v"
|
|
|
|
# - name: Generate file MD5
|
|
# run: |
|
|
# echo "current commit sha: ${{ env.COMMIT_SHA }}"
|
|
# cd android/app/build/outputs/apk/release
|
|
# md5sum *.apk
|
|
|
|
# - name: Upload Artifact
|
|
# uses: ./.github/actions/upload-artifact
|
|
# env:
|
|
# PACKAGE_TYPE: 'Android_SL'
|
|
# PACKAGE_VERSION: ${{ env.PACKAGE_VERSION }}
|
|
|
|
# Android_5:
|
|
# name: Android_5
|
|
# runs-on: ubuntu-latest
|
|
# steps:
|
|
# - name: Check out git repository
|
|
# uses: actions/checkout@v4
|
|
# with:
|
|
# ref: android_5
|
|
|
|
# - name: Setup Env
|
|
# uses: ./.github/actions/setup
|
|
|
|
# - name: Build Packages
|
|
# shell: bash
|
|
# run: |
|
|
# cd android
|
|
# echo ${{ secrets.KEYSTORE_STORE_FILE_BASE64 }} | base64 --decode > app/${{ secrets.KEYSTORE_STORE_FILE }}
|
|
# ./gradlew assembleRelease -PMYAPP_UPLOAD_STORE_FILE='${{ secrets.KEYSTORE_STORE_FILE }}' -PMYAPP_UPLOAD_KEY_ALIAS='${{ secrets.KEYSTORE_KEY_ALIAS }}' -PMYAPP_UPLOAD_STORE_PASSWORD='${{ secrets.KEYSTORE_PASSWORD }}' -PMYAPP_UPLOAD_KEY_PASSWORD='${{ secrets.KEYSTORE_KEY_PASSWORD }}'
|
|
# rm -f app/${{ secrets.KEYSTORE_STORE_FILE }}
|
|
|
|
# # Push tag to GitHub if package.json version's tag is not tagged
|
|
# - name: Get package version
|
|
# run: |
|
|
# node -p -e '`PACKAGE_VERSION=${require("./package.json").version}`' >> $GITHUB_ENV
|
|
# echo "COMMIT_SHA=$(git show -s --format=%H)" >> $GITHUB_ENV
|
|
|
|
# - name: Create git tag
|
|
# uses: pkgdeps/git-tag-action@v3
|
|
# with:
|
|
# github_token: ${{ secrets.GITHUB_TOKEN }}
|
|
# github_repo: ${{ github.repository }}
|
|
# version: ${{ env.PACKAGE_VERSION }}
|
|
# git_commit_sha: ${{ env.COMMIT_SHA }}
|
|
# git_tag_prefix: "v"
|
|
|
|
# - name: Generate file MD5
|
|
# run: |
|
|
# echo "current commit sha: ${{ env.COMMIT_SHA }}"
|
|
# cd android/app/build/outputs/apk/release
|
|
# md5sum *.apk
|
|
|
|
# - name: Upload Artifact
|
|
# uses: ./.github/actions/upload-artifact
|
|
# env:
|
|
# PACKAGE_TYPE: 'Android_5'
|
|
# PACKAGE_VERSION: ${{ env.PACKAGE_VERSION }}
|
|
|
|
Release:
|
|
name: Release
|
|
runs-on: ubuntu-latest
|
|
# needs: [Android, Android_SL]
|
|
needs: [Android]
|
|
steps:
|
|
- name: Check out git repository
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Download Artifacts
|
|
uses: actions/download-artifact@v4
|
|
with:
|
|
path: ./artifacts
|
|
merge-multiple: true
|
|
|
|
- name: Generate file MD5
|
|
run: |
|
|
echo -e '\n### File MD5\n```' >> ./publish/changeLog.md
|
|
cd artifacts
|
|
md5sum *.apk >> ../publish/changeLog.md
|
|
echo -e '```\n' >> ../publish/changeLog.md
|
|
echo -e '\n[软件安装包说明](https://lyswhut.github.io/lx-music-doc/download#%E8%BD%AF%E4%BB%B6%E5%AE%89%E8%A3%85%E5%8C%85%E8%AF%B4%E6%98%8E)\n' >> ../publish/changeLog.md
|
|
|
|
- name: Get package version
|
|
run: |
|
|
PACKAGE_VERSION=$(node -p "require('./package.json').version")
|
|
echo "PACKAGE_VERSION=$PACKAGE_VERSION" >> $GITHUB_ENV
|
|
|
|
- name: Release
|
|
uses: softprops/action-gh-release@v2
|
|
with:
|
|
body_path: ./publish/changeLog.md
|
|
prerelease: false
|
|
draft: false
|
|
tag_name: v${{ env.PACKAGE_VERSION }}
|
|
files: |
|
|
artifacts/lx-music-mobile-v${{ env.PACKAGE_VERSION }}-arm64-v8a.apk
|
|
artifacts/lx-music-mobile-v${{ env.PACKAGE_VERSION }}-armeabi-v7a.apk
|
|
artifacts/lx-music-mobile-v${{ env.PACKAGE_VERSION }}-x86_64.apk
|
|
artifacts/lx-music-mobile-v${{ env.PACKAGE_VERSION }}-x86.apk
|
|
artifacts/lx-music-mobile-v${{ env.PACKAGE_VERSION }}-universal.apk
|
|
|
|
# artifacts/lx-music-mobile-v${{ env.PACKAGE_VERSION }}-sl-arm64-v8a.apk
|
|
# artifacts/lx-music-mobile-v${{ env.PACKAGE_VERSION }}-android_5-universal.apk
|
|
env:
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|