Skip to content

Commit

Permalink
feat: github actions build apk
Browse files Browse the repository at this point in the history
  • Loading branch information
lisonge committed Sep 3, 2023
1 parent 6a899a1 commit 9f41d05
Show file tree
Hide file tree
Showing 3 changed files with 59 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,23 +2,20 @@ name: Apk-Build

on:
workflow_dispatch:
inputs:
name:
description: 'Person to greet'
required: true
default: 'Mona the Octocat'

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3

- uses: actions/setup-java@v3
with:
distribution: 'adopt'
java-version: '17'
- run: chmod 777 ./gradlew
- run: ./gradlew build

- name: Archive artifacts
uses: actions/upload-artifact@v2
with:
Expand Down
55 changes: 55 additions & 0 deletions .github/workflows/Build-Release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
name: Build Release

on:
push:
tags:
- v*

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3

- uses: actions/setup-java@v3
with:
distribution: 'adopt'
java-version: '17'
- 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: app-release-${{ github.ref_name }}.apk
asset_content_type: application/vnd.android.package-archive
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,4 @@
local.properties
.idea
/kotlin-js-store
.vscode

0 comments on commit 9f41d05

Please sign in to comment.