gkd/.github/workflows/Build-Release.yml

76 lines
2.2 KiB
YAML
Raw Normal View History

2023-11-21 18:33:34 +08:00
name: Build-Release
2023-09-03 13:48:06 +08:00
on:
push:
tags:
- v*
jobs:
build:
runs-on: ubuntu-latest
steps:
2023-11-29 15:24:39 +08:00
- uses: actions/checkout@v4
2023-09-03 13:48:06 +08:00
- uses: actions/setup-java@v3
with:
distribution: 'adopt'
java-version: '17'
2023-09-05 20:04:08 +08:00
2023-11-29 14:59:41 +08:00
- name: write secrets info
run: |
echo GKD_BUGLY_APP_ID='${{ secrets.GKD_BUGLY_APP_ID }}' >> gradle.properties
echo ${{ secrets.GKD_STORE_FILE_BASE64 }} | base64 --decode > ${{ github.workspace }}/key.jks
echo GKD_STORE_FILE='${{ github.workspace }}/key.jks' >> gradle.properties
echo GKD_STORE_PASSWORD='${{ secrets.GKD_STORE_PASSWORD }}' >> gradle.properties
echo GKD_KEY_ALIAS='${{ secrets.GKD_KEY_ALIAS }}' >> gradle.properties
echo GKD_KEY_PASSWORD='${{ secrets.GKD_KEY_PASSWORD }}' >> gradle.properties
2023-09-03 13:48:06 +08:00
- run: chmod 777 ./gradlew
- run: ./gradlew build
2023-11-21 18:33:34 +08:00
- uses: actions/upload-artifact@v3
2023-09-03 13:48:06 +08:00
with:
2023-11-21 18:33:34 +08:00
name: outputs
path: app/build/outputs
2023-09-03 13:48:06 +08:00
release:
needs: build
permissions: write-all
runs-on: ubuntu-latest
steps:
2023-11-21 18:33:34 +08:00
- uses: actions/download-artifact@v3
2023-09-03 13:48:06 +08:00
with:
2023-11-21 18:33:34 +08:00
name: outputs
2023-11-22 20:22:43 +08:00
path: outputs
- run: ls -R
2023-09-03 13:48:06 +08:00
2023-11-21 18:33:34 +08:00
- id: create_release
2023-09-03 13:48:06 +08:00
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.ref }}
release_name: Release ${{ github.ref }}
2023-11-21 18:33:34 +08:00
draft: true
2023-09-03 13:48:06 +08:00
2023-11-21 18:33:34 +08:00
- uses: actions/upload-release-asset@v1
2023-09-03 13:48:06 +08:00
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
2023-11-21 18:33:34 +08:00
asset_path: outputs/apk/release/app-release.apk
2023-10-04 18:24:09 +08:00
asset_name: gkd-${{ github.ref_name }}.apk
2023-09-03 13:48:06 +08:00
asset_content_type: application/vnd.android.package-archive
2023-11-21 18:33:34 +08:00
- run: zip -r outputs.zip outputs
- uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: outputs.zip
2023-11-27 20:16:32 +08:00
asset_name: outputs-${{ github.ref_name }}.zip
2023-11-21 18:33:34 +08:00
asset_content_type: application/zip