Skip to content

Commit

Permalink
Merge pull request #4 from jsherm-fwdsec/fix-fork-action
Browse files Browse the repository at this point in the history
Fix fork action
  • Loading branch information
jsherm-fwdsec authored Sep 19, 2022
2 parents 402f377 + 457c8eb commit 8d824a8
Showing 1 changed file with 39 additions and 24 deletions.
63 changes: 39 additions & 24 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Build & Release
name: Debug & Release

on:
# Triggers the workflow on every pull request to master branch
Expand All @@ -17,7 +17,7 @@ on:
workflow_dispatch:

jobs:
build:
debug:
runs-on: ubuntu-latest
defaults:
run:
Expand All @@ -40,12 +40,42 @@ jobs:
distribution: 'temurin'
java-version: '11'

- name: Build the app
- name: Build debug APK
run: ./gradlew assembleDebug

- name: Upload debug APK
uses: actions/upload-artifact@v2
with:
name: app-debug
path: ./Android/MSTG-Android-Kotlin-App/app/build/outputs/apk/debug/app-debug.apk

release:
runs-on: ubuntu-latest
if: startsWith(github.ref, 'refs/tags/')
defaults:
run:
working-directory: Android/MSTG-Android-Kotlin-App

steps:
- name: Checkout the code
uses: actions/checkout@v2

- uses: actions/cache@v2
with:
path: |
~/.gradle/caches
~/.gradle/wrapper
key: ${{ runner.os }}-${{ hashFiles('**/*.gradle*') }}-${{ hashFiles('**/gradle/wrapper/gradle-wrapper.properties') }}-${{ hashFiles('**/buildSrc/**/*.kt') }}

- name: Set up JDK
uses: actions/setup-java@v3
with:
distribution: 'temurin'
java-version: '11'

- name: Build release APK
run: ./gradlew assembleRelease

- name: List Downloaded artifacts (sampling of download-artifact)
run: ls -l


- uses: ilharp/sign-android-release@v1
name: Sign app APK
# ID used to access action output
Expand All @@ -57,31 +87,16 @@ jobs:
keyStorePassword: ${{ secrets.SIGNING_STORE_PASSWORD }}
keyPassword: ${{ secrets.SIGNING_KEY_PASSWORD }}

- name: Rename build
- name: Rename signed APK
run: mv ./app/build/outputs/apk/release/app-release-unsigned-signed.apk ./app/build/outputs/apk/release/MASTG-Android.apk

- name: Upload APK
uses: actions/upload-artifact@v2
with:
name: app-release
path: ./Android/MSTG-Android-Kotlin-App/app/build/outputs/apk/release/MASTG-Android.apk

release:
runs-on: ubuntu-latest
needs: [build]
if: startsWith(github.ref, 'refs/tags/')
steps:
- uses: actions/download-artifact@v2
- name: List Downloaded artifacts (sampling of download-artifact)
run: ls -l

- name: Release
uses: softprops/action-gh-release@v1
with:
prerelease: false
draft: true
generate_release_notes: true
files: |
app-release/*.apk
./app/build/outputs/apk/release/MASTG-Android.apk
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

0 comments on commit 8d824a8

Please sign in to comment.