2024-04-19 15:49:30 -06:00
|
|
|
name: Release
|
|
|
|
|
|
|
|
on:
|
|
|
|
workflow_dispatch:
|
2024-04-21 14:40:09 -06:00
|
|
|
inputs:
|
|
|
|
title:
|
|
|
|
type: string
|
|
|
|
description: 'Title'
|
|
|
|
required: true
|
|
|
|
default: 'v0.00.0 R0'
|
|
|
|
is_pre_release:
|
|
|
|
type: boolean
|
|
|
|
description: 'Set as a pre-release'
|
|
|
|
required: true
|
|
|
|
default: true
|
2024-04-19 15:49:30 -06:00
|
|
|
|
|
|
|
jobs:
|
2024-04-21 14:40:09 -06:00
|
|
|
build-and-release:
|
2024-04-19 15:49:30 -06:00
|
|
|
runs-on: ubuntu-latest
|
2024-04-21 14:40:09 -06:00
|
|
|
|
2024-04-20 10:12:58 -06:00
|
|
|
permissions: write-all
|
|
|
|
|
2024-04-19 15:49:30 -06:00
|
|
|
steps:
|
2024-04-20 10:12:58 -06:00
|
|
|
- name: Checkout branch "${{ github.ref_name }}"
|
|
|
|
run: |
|
2024-07-26 22:55:05 +03:00
|
|
|
git clone --no-checkout https://github.com/MaintainTeam/LastPipeBender.git .
|
2024-04-20 10:12:58 -06:00
|
|
|
git config core.symlinks false
|
|
|
|
git checkout --progress --force ${{ github.ref_name }}
|
2024-04-21 14:40:09 -06:00
|
|
|
|
2024-04-20 10:12:58 -06:00
|
|
|
- name: Set up JDK 17
|
|
|
|
uses: actions/setup-java@v4
|
|
|
|
with:
|
|
|
|
java-version: 17
|
|
|
|
distribution: "temurin"
|
|
|
|
cache: 'gradle'
|
|
|
|
|
|
|
|
- name: Build release APK
|
2024-04-21 14:40:09 -06:00
|
|
|
run: ./gradlew assembleRelease
|
|
|
|
|
|
|
|
- name: Sign APK
|
2024-04-20 10:12:58 -06:00
|
|
|
env:
|
2024-04-21 14:40:09 -06:00
|
|
|
KEYSTORE: ${{ secrets.KEYSTORE }}
|
2024-04-20 10:12:58 -06:00
|
|
|
SIGNING_STORE_PASSWORD: ${{ secrets.SIGNING_STORE_PASSWORD }}
|
2024-04-21 14:40:09 -06:00
|
|
|
run: |
|
|
|
|
version=$( grep "versionName" app/build.gradle | awk -F'"' '{print $2}' )
|
|
|
|
echo "${KEYSTORE}" | base64 -d > apksign.keystore
|
|
|
|
${ANDROID_HOME}/build-tools/34.0.0/apksigner sign --ks apksign.keystore --ks-pass env:SIGNING_STORE_PASSWORD "app/build/outputs/apk/release/app-release-unsigned.apk"
|
2024-07-26 22:55:05 +03:00
|
|
|
mv app/build/outputs/apk/release/app-release-unsigned.apk app/build/outputs/apk/release/"lastpipebender_v${version}.apk"
|
2024-04-21 14:40:09 -06:00
|
|
|
|
2024-12-02 07:35:56 +03:00
|
|
|
- name: Generate checksum
|
|
|
|
run: |
|
|
|
|
sha256sum app/build/outputs/apk/release/*.apk > app/build/outputs/apk/release/checksums.txt
|
|
|
|
echo "::notice::$(app/build/outputs/apk/release/checksums.txt)"
|
|
|
|
|
|
|
|
|
2024-04-21 14:40:09 -06:00
|
|
|
- name: Create release and upload
|
|
|
|
run: |
|
|
|
|
version=$( grep "versionName" app/build.gradle | awk -F'"' '{print $2}' )
|
|
|
|
gh auth login --with-token <<<"${{ secrets.GITHUB_TOKEN }}"
|
2024-07-26 22:55:05 +03:00
|
|
|
gh release create "v${version}" --title "${{ inputs.title }}" --notes-file ".github/changelog.md" --prerelease=${{ inputs.is_pre_release }} --repo MaintainTeam/LastPipeBender
|
2024-12-02 07:35:56 +03:00
|
|
|
gh release upload "v${version}" app/build/outputs/apk/release/{*.apk,checksums.txt} --repo MaintainTeam/LastPipeBender
|
|
|
|
|
2024-04-20 10:12:58 -06:00
|
|
|
|
2024-04-21 14:40:09 -06:00
|
|
|
- name: Archive reports for job
|
2024-04-20 10:12:58 -06:00
|
|
|
uses: actions/upload-artifact@v4
|
|
|
|
with:
|
2024-04-21 14:40:09 -06:00
|
|
|
name: reports
|
|
|
|
path: '*/build/reports'
|
|
|
|
if: ${{ always() }}
|