Skip to content

Commit

Permalink
perf(actions): use outputs
Browse files Browse the repository at this point in the history
  • Loading branch information
lisonge committed Nov 21, 2023
1 parent b5b8b1d commit ab68c5a
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 19 deletions.
9 changes: 4 additions & 5 deletions .github/workflows/Build-Apk.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Apk-Build
name: Build-Apk

on:
workflow_dispatch:
Expand Down Expand Up @@ -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
35 changes: 21 additions & 14 deletions .github/workflows/Build-Release.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Build Release
name: Build-Release

on:
push:
Expand Down Expand Up @@ -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

0 comments on commit ab68c5a

Please sign in to comment.