perf(actions): use outputs

This commit is contained in:
lisonge 2023-11-21 18:33:34 +08:00
parent b5b8b1dfe7
commit ab68c5ac57
2 changed files with 25 additions and 19 deletions

View File

@ -1,4 +1,4 @@
name: Apk-Build
name: Build-Apk
on:
workflow_dispatch:
@ -35,8 +35,7 @@ jobs:
- run: chmod 777 ./gradlew
- run: ./gradlew build
- name: Archive artifacts
uses: actions/upload-artifact@v2
- uses: actions/upload-artifact@v3
with:
name: build-outputs-apk.zip
path: app/build/outputs/apk
name: outputs.zip
path: app/build/outputs

View File

@ -1,4 +1,4 @@
name: Build Release
name: Build-Release
on:
push:
@ -32,38 +32,45 @@ jobs:
- run: chmod 777 ./gradlew
- run: ./gradlew build
- name: Upload Asset
uses: actions/upload-artifact@v3
- uses: actions/upload-artifact@v3
with:
name: app-release.apk
path: app/build/outputs/apk/release/app-release.apk
name: outputs
path: app/build/outputs
release:
needs: build
permissions: write-all
runs-on: ubuntu-latest
steps:
- name: Download Asset
uses: actions/download-artifact@v3
- uses: actions/download-artifact@v3
with:
name: app-release.apk
name: outputs
- name: Create Release
id: 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 }}
draft: true
- name: Upload Release Asset
id: upload-release-asset
uses: actions/upload-release-asset@v1
- 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_path: outputs/apk/release/app-release.apk
asset_name: gkd-${{ github.ref_name }}.apk
asset_content_type: application/vnd.android.package-archive
- 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
asset_name: outputs.zip
asset_content_type: application/zip