feat: 在 TAG 时自动发布为 PreRelease 以便MAA 主仓库可以自动拉取最新的 MaaTouch #22
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Android CI | |
on: | |
push: | |
pull_request: | |
workflow_dispatch: | |
jobs: | |
build: | |
name: Build | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
show-progress: false | |
- name: set up JDK 17 | |
uses: actions/setup-java@v3 | |
with: | |
java-version: '17' | |
distribution: 'temurin' | |
cache: gradle | |
- name: Grant execute permission for gradlew | |
run: chmod +x gradlew | |
- name: Build with Gradle | |
run: ./gradlew build | |
- name: Copy file | |
run: cp ./app/build/outputs/apk/release/app-release-unsigned.apk ./maatouch | |
- name: Upload artifact | |
uses: actions/upload-artifact@v4 | |
with: | |
name: maatouch | |
path: ./maatouch | |
- name: Release when tag is created | |
uses: softprops/action-gh-release@v1 | |
if: startsWith(github.ref, 'refs/tags/') | |
with: | |
files: ./maatouch | |
tag_name: ${{ github.ref_name }} | |
token: ${{ secrets.GITHUB_TOKEN }} | |
prerelease: true |