Update android.yml
This commit is contained in:
parent
47583d2250
commit
4442e3a94a
1 changed files with 15 additions and 11 deletions
26
.github/workflows/android.yml
vendored
26
.github/workflows/android.yml
vendored
|
|
@ -2,9 +2,9 @@ name: Android Release Build and Publish
|
|||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- master
|
||||
workflow_dispatch:
|
||||
tags:
|
||||
- 'v*' # 当推送一个新的版本标签(例如 v1.0.0)时触发
|
||||
workflow_dispatch: # 支持手动触发
|
||||
|
||||
jobs:
|
||||
build:
|
||||
|
|
@ -27,36 +27,40 @@ jobs:
|
|||
- name: Grant execute permission for gradlew
|
||||
run: chmod +x ./gradlew
|
||||
|
||||
# Step 4: Build the release APK
|
||||
# Step 4: Clean the project
|
||||
- name: Clean build directory
|
||||
run: ./gradlew clean
|
||||
|
||||
# Step 5: Build the release APK
|
||||
- name: Build release APK
|
||||
run: ./gradlew assembleRelease
|
||||
|
||||
# Step 5: Archive the generated APK
|
||||
# Step 6: Archive the generated APK
|
||||
- name: Archive release APK
|
||||
uses: actions/upload-artifact@v3
|
||||
with:
|
||||
name: lobe-chat-android-beta.apk
|
||||
path: app/build/outputs/apk/release/lobe-chat-android-beta.apk
|
||||
path: app/build/outputs/apk/release/app-release.apk
|
||||
|
||||
# Step 6: Create a GitHub Release
|
||||
# Step 7: Create a GitHub Release
|
||||
- name: Create Release
|
||||
id: create_release
|
||||
uses: actions/create-release@v1
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
with:
|
||||
tag_name: ${{ github.sha }} # 使用提交 SHA 或者你可以手动指定一个版本标签
|
||||
release_name: Release-${{ github.sha }}
|
||||
tag_name: ${{ github.ref_name }} # 使用版本标签
|
||||
release_name: Release ${{ github.ref_name }}
|
||||
draft: false
|
||||
prerelease: false
|
||||
|
||||
# Step 7: Upload APK to the Release
|
||||
# Step 8: Upload APK to the Release
|
||||
- name: Upload Release Asset
|
||||
uses: actions/upload-release-asset@v1
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
with:
|
||||
upload_url: ${{ steps.create_release.outputs.upload_url }}
|
||||
asset_path: app/build/outputs/apk/release/lobe-chat-android-beta.apk
|
||||
asset_path: app/build/outputs/apk/release/app-release.apk
|
||||
asset_name: lobe-chat-android-beta.apk
|
||||
asset_content_type: application/vnd.android.package-archive
|
||||
|
|
|
|||
Loading…
Reference in a new issue