mirror of
https://github.com/gkd-kit/gkd.git
synced 2024-11-16 03:32:38 +08:00
70 lines
1.7 KiB
YAML
70 lines
1.7 KiB
YAML
name: Build Release
|
|
|
|
on:
|
|
push:
|
|
tags:
|
|
- v*
|
|
|
|
env:
|
|
BUGLY_TOKEN: ${{ secrets.BUGLY_TOKEN }}
|
|
|
|
jobs:
|
|
build:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v3
|
|
|
|
- uses: actions/setup-java@v3
|
|
with:
|
|
distribution: 'adopt'
|
|
java-version: '17'
|
|
cache: 'gradle'
|
|
|
|
- uses: actions/cache@v3
|
|
with:
|
|
path: |
|
|
~/.gradle/caches
|
|
~/.gradle/wrapper
|
|
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }}
|
|
restore-keys: |
|
|
${{ runner.os }}-gradle-
|
|
|
|
- run: chmod 777 ./gradlew
|
|
- run: ./gradlew build
|
|
|
|
- name: Upload Asset
|
|
uses: actions/upload-artifact@v3
|
|
with:
|
|
name: app-release.apk
|
|
path: app/build/outputs/apk/release/app-release.apk
|
|
|
|
release:
|
|
needs: build
|
|
permissions: write-all
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Download Asset
|
|
uses: actions/download-artifact@v3
|
|
with:
|
|
name: app-release.apk
|
|
|
|
- name: Create Release
|
|
id: create_release
|
|
uses: actions/create-release@v1
|
|
env:
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
with:
|
|
tag_name: ${{ github.ref }}
|
|
release_name: Release ${{ github.ref }}
|
|
|
|
- name: Upload Release Asset
|
|
id: 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-release.apk
|
|
asset_name: gkd-${{ github.ref_name }}.apk
|
|
asset_content_type: application/vnd.android.package-archive
|