Skip to content

Commit

Permalink
Revise workflows
Browse files Browse the repository at this point in the history
  • Loading branch information
danielchalmers committed Jan 21, 2024
1 parent 383faa1 commit 7068165
Show file tree
Hide file tree
Showing 3 changed files with 80 additions and 43 deletions.
Original file line number Diff line number Diff line change
@@ -1,37 +1,37 @@
name: Build and deploy
name: Full build

on:
push:
branches:
- main
description: Builds and tests

jobs:
android:
runs-on: windows-latest
steps:
runs:
using: "composite"
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0 # Need full history for git versioning

- name: Create keystore
id: create_keystore
uses: timheuer/[email protected]
with:
fileName: release.keystore
encodedString: "${{ secrets.RELEASE_KEYSTORE_BASE64 }}"

- uses: actions/setup-dotnet@v3

- name: Show .NET info
shell: bash
run: dotnet --info

- name: Install .NET MAUI
shell: bash
run: dotnet workload install maui android wasm-tools

- name: Test
shell: bash
run: dotnet test

- name: Create keystore
id: create_keystore
uses: timheuer/[email protected]
with:
fileName: release.keystore
encodedString: "${{ secrets.RELEASE_KEYSTORE_BASE64 }}"

- name: Build for Android
shell: bash
run: >
dotnet publish JournalApp\JournalApp.csproj -o publish -c:Release -f:net8.0-android
-p:AndroidKeyStore=True
Expand All @@ -40,31 +40,6 @@ jobs:
-p:AndroidSigningKeyAlias="key"
-p:AndroidSigningKeyPass="${{ secrets.RELEASE_KEYSTORE_PASS }}"
- name: Show build output
- name: List build output
shell: bash
run: ls publish

- uses: actions/upload-artifact@v4
with:
path: |
publish
# publish/*.apk
# publish/*.aab
if-no-files-found: error

# - name: Create GitHub release
# uses: softprops/action-gh-release@v1
# with:
# files: |
# publish/*.apk
# publish/*.aab
# fail_on_unmatched_files: true
# generate_release_notes: true

- name: Upload to Play Store
uses: r0adkll/upload-google-play@v1
with:
serviceAccountJsonPlainText: "${{ secrets.SERVICE_ACCOUNT_JSON }}"
packageName: com.danielchalmers.journalapp
releaseFiles: publish/*-Signed.aab
track: beta
status: completed
23 changes: 23 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: Build

on:
push:
branches-ignore:
- release
pull_request:

jobs:
build:
runs-on: windows-latest
steps:
- uses: actions/checkout@v4

- uses: ./.github/actions/full-build

- uses: actions/upload-artifact@v4
with:
path: |
publish
# publish/*.apk
# publish/*.aab
if-no-files-found: error
39 changes: 39 additions & 0 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: Deploy

on:
push:
branches:
- release

jobs:
android:
runs-on: windows-latest
steps:
- uses: actions/checkout@v4

- uses: ./.github/actions/full-build

- uses: dotnet/[email protected]
id: nbgv

- name: Create GitHub release
uses: ncipollo/release-action@v1
with:
tag: "v${{ steps.nbgv.outputs.SimpleVersion }}"
artifacts: "publish/*.apk"
allowUpdates: true
removeArtifacts: true
replacesArtifacts: true
artifactErrorsFailBuild: true
makeLatest: true
generateReleaseNotes: true
prerelease: ${{ !steps.nbgv.outputs.PublicRelease }}

- name: Upload to Play Store
uses: r0adkll/upload-google-play@v1
with:
serviceAccountJsonPlainText: "${{ secrets.SERVICE_ACCOUNT_JSON }}"
packageName: com.danielchalmers.journalapp
releaseFiles: publish/*-Signed.aab
track: beta
status: completed

0 comments on commit 7068165

Please sign in to comment.