Skip to content

use github token to download eidmsdk pkg #7

use github token to download eidmsdk pkg

use github token to download eidmsdk pkg #7

name: Build and sign application for Android
on:
push:
tags:
- "v[0-9]+.[0-9]+.[0-9]+"
- "v[0-9]+.[0-9]+.[0-9]+([0-9]+)"
workflow_dispatch:
inputs:
name:
description: "Release-Build-Android"
default: "Generate release build for Android"
permissions:
contents: write
jobs:
build:
environment: packaging
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
path: app
- name: Checkout "eidmsdk_flutter"
uses: actions/checkout@v4
with:
repository: slovensko-digital/eidmsdk-flutter
path: eidmsdk_flutter
- name: Checkout "autogram_sign"
uses: actions/checkout@v4
with:
repository: slovensko-digital/avm-client-dart
path: autogram_sign
- uses: actions/setup-java@v1
with:
java-version: '17.x'
- uses: subosito/flutter-action@v1
with:
flutter-version: '3.16.5'
channel: 'stable'
- name: Install dependencies
working-directory: ./app
run: flutter pub get
- name: Test
working-directory: ./app
run: flutter test
- name: Decode Keystore
env:
ENCODED_STRING: ${{ secrets.GOOGLE_KEYSTORE_BASE_64 }}
working-directory: ./app
run: echo $ENCODED_STRING | base64 -d > release_keystore.jks
- name: Build Googla Play .aab
env:
AVM_KEYSTORE_FILE: ../../release_keystore.jks
AVM_KEYSTORE_PASSWORD: ${{ secrets.GOOGLE_RELEASE_KEYSTORE_PASSWORD }}
AVM_KEY_ALIAS: ${{ secrets.GOOGLE_RELEASE_KEYSTORE_ALIAS }}
AVM_KEY_PASSWORD: ${{ secrets.GOOGLE_RELEASE_KEY_PASSWORD }}
EIDMSDK_ACCESS_TOKEN: ${{ secrets.GITHUB_TOKEN }}
working-directory: ./app
run: flutter build appbundle --release
- name: Build Andorid .apk
env:
AVM_KEYSTORE_FILE: ../../release_keystore.jks
AVM_KEYSTORE_PASSWORD: ${{ secrets.GOOGLE_RELEASE_KEYSTORE_PASSWORD }}
AVM_KEY_ALIAS: ${{ secrets.GOOGLE_RELEASE_KEYSTORE_ALIAS }}
AVM_KEY_PASSWORD: ${{ secrets.GOOGLE_RELEASE_KEY_PASSWORD }}
EIDMSDK_ACCESS_TOKEN: ${{ secrets.GITHUB_TOKEN }}
working-directory: ./app
run: flutter build apk --release
- name: Upload .aab Build to Artifacts
uses: actions/upload-artifact@v3
with:
name: release-artifacts
path: ./app/build/app/outputs/bundle/release/app-release.aab
- name: Upload .apk Build to Artifacts
uses: actions/upload-artifact@v3
with:
name: release-artifacts
path: ./app/build/app/outputs/apk/release/app-release.apk
- name: Create release if tag pushed
uses: softprops/action-gh-release@de2c0eb89ae2a093876385947365aca7b0e5f844
if: startsWith(github.ref, 'refs/tags/')
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
draft: true
prerelease: true
files: |
./app/build/app/outputs/bundle/release/app-release.aab
./app/build/app/outputs/apk/release/app-release.apk