Skip to content

Setting a minimum year for operation (#23) #61

Setting a minimum year for operation (#23)

Setting a minimum year for operation (#23) #61

Workflow file for this run

name: Build
on: push
# push:
# branches:
# - '**'
# tags:
# - 'v*' # Push events to matching v*, i.e. v1.0, v20.15.10
jobs:
build:
name: Build APK
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Set up JDK environment
uses: actions/setup-java@v2
with:
distribution: 'zulu'
java-version: 11
#cache: 'gradle'
- name: Build release APK
run: |
./gradlew assembleRelease --no-daemon
- name: Sign APK
id: sign_app
uses: r0adkll/sign-android-release@v1
with:
releaseDirectory: app/build/outputs/apk/release
signingKeyBase64: ${{ secrets.KEYSTORE }}
alias: ${{ secrets.KEYALIAS }}
keyStorePassword: ${{ secrets.KEYSTORE_PASSWORD }}
keyPassword: ${{ secrets.KEY_PASSWORD }}
env:
# override default build-tools version (29.0.3) -- optional
BUILD_TOOLS_VERSION: "30.0.2"
- name: Rename APK
id: rename_apk
run: |
RELEASE_APK_PATH=app/build/outputs/apk/release/SportiduinoApp-${{ github.ref_name }}.apk
ARTIFACT_APK_PATH=${{ github.workspace }}-$(git rev-parse --short HEAD).apk
mv ${{ steps.sign_app.outputs.signedReleaseFile }} ${RELEASE_APK_PATH}
cp ${RELEASE_APK_PATH} ${ARTIFACT_APK_PATH}
echo "::set-output name=release_apk_path::${RELEASE_APK_PATH}"
echo "::set-output name=artifact_apk_path::${ARTIFACT_APK_PATH}"
- name: Upload APK
uses: actions/upload-artifact@v3
with:
name: SportiduinoApp
path: ${{ steps.rename_apk.outputs.artifact_apk_path }}
- name: Generate Changelog
if: startsWith(github.ref, 'refs/tags/v')
run: |
# Get text after for this release from changelog files
sed -n "/^##.*${{ github.ref_name }}$/,/^##/{/^##/d ; p}" CHANGELOG.md | sed -z "s/^\n*//g" - > ${{ github.workspace }}-CHANGELOG.txt
printf "\n---\n" >> ${{ github.workspace }}-CHANGELOG.txt
sed -n "/^##.*${{ github.ref_name }}$/,/^##/{/^##/d ; p}" CHANGELOG.ru.md | sed -z "s/^\n*//g" - >> ${{ github.workspace }}-CHANGELOG.txt
- name: Create release
uses: softprops/action-gh-release@v1
if: startsWith(github.ref, 'refs/tags/v')
with:
body_path: ${{ github.workspace }}-CHANGELOG.txt
files: ${{ steps.rename_apk.outputs.release_apk_path }}
# vim: ts=2 sw=2 et