Skip to content
This repository has been archived by the owner on Jun 29, 2024. It is now read-only.

Commit

Permalink
Build and add APKs to github release (#96)
Browse files Browse the repository at this point in the history
* Make Flutter Build workflow reusable

* provide artifact name via input variable (with default value)

* Automatically add build artifacts to github release

* workaround for actions/runner#480
  • Loading branch information
le-jou authored Sep 5, 2022
1 parent 570ec48 commit 345d03b
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 1 deletion.
11 changes: 10 additions & 1 deletion .github/workflows/flutter_build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,14 @@ on:
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:

# Allows this workflow to be called from other workflows
workflow_call:
inputs:
artifactName:
description: "Name of the uploaded artifact"
required: true
type: string

# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
# This workflow contains a single job called "build"
Expand All @@ -25,6 +33,7 @@ jobs:
KEY_PATH: /home/runner/key.jks
KEY_PASSWORD: ${{ secrets.KEY_PASSWORD }}
KEY_ALIAS: key
ARTIFACT_NAME: ${{ inputs.artifactName || 'release-apk' }}

steps:
- uses: actions/checkout@v2
Expand All @@ -44,6 +53,6 @@ jobs:
- name: Archive artifacts
uses: actions/upload-artifact@v2
with:
name: release-apk
name: ${{ env.ARTIFACT_NAME }}
path: |
build/app/outputs/apk/*
27 changes: 27 additions & 0 deletions .github/workflows/github_release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: Github Release

on:
release:
types: [published]

jobs:
build:
uses: ./.github/workflows/flutter_build.yml
secrets: inherit
with:
artifactName: 'release'

add-artifacts-to-release:
runs-on: ubuntu-latest
needs: build

steps:
- name: Download artifacts
uses: actions/download-artifact@v3
with:
name: 'release'

- name: Add artifacts to release
uses: softprops/action-gh-release@v1
with:
files: 'release/*.apk'

0 comments on commit 345d03b

Please sign in to comment.