Skip to content

Commit

Permalink
#48 Build config for github actions
Browse files Browse the repository at this point in the history
  • Loading branch information
rnyholm authored Feb 16, 2024
1 parent 51b0346 commit d1e9941
Showing 1 changed file with 56 additions and 0 deletions.
56 changes: 56 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
name: Runners Calculator build

on:
push:
branches-ignore:
- gh-pages

jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Decode keystore
env:
ENCODED_STRING: ${{ secrets.KEYSTORE }}
run: |
TMP_KEYSTORE_FILE_PATH="${RUNNER_TEMP}"/keystore
mkdir "${TMP_KEYSTORE_FILE_PATH}"
echo $ENCODED_STRING | base64 -di > "${TMP_KEYSTORE_FILE_PATH}"/runcalc.jks
- name: Checkout code
- uses: actions/checkout@v3

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

- name: Grant execute permission for gradlew
run: chmod +x ./gradlew

- name: Build with Gradle
run: ./gradlew clean build check assembleRelease
env:
SIGNING_KEY_ALIAS: ${{ secrets.SIGNING_KEY_ALIAS }}
SIGNING_KEY_PASSWORD: ${{ secrets.SIGNING_KEY_PASSWORD }}
SIGNING_STORE_PASSWORD: ${{ secrets.SIGNING_STORE_PASSWORD }}

- name: Upload build artifacts
uses: actions/upload-artifact@v2
with:
name: Build Artifacts
path: app/build/outputs/

- name: Upload apk to release
if: github.ref == 'refs/heads/master' && github.event_name == 'release'
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GH_ACTIONS_ACCESS_TOKEN }}
file: app/build/outputs/apk/release/*release.apk
tag: ${{ github.ref }}
body: ""
overwrite: true
file_glob: true

0 comments on commit d1e9941

Please sign in to comment.