Skip to content

Commit

Permalink
Merge pull request #7 from MaintainTeam/release-ci
Browse files Browse the repository at this point in the history
ci: create release file
  • Loading branch information
asandikci authored Jan 26, 2025
2 parents 0410db5 + 6d65bf8 commit 8e536fe
Show file tree
Hide file tree
Showing 2 changed files with 81 additions and 0 deletions.
1 change: 1 addition & 0 deletions .github/changelog.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
- THIS IS A PRE-RELEASE/RELEASE OUTPUT BY GITHUB ACTIONS - WAIT MAINTAINER/AUTHOR TO UPDATE THIS CHANGELOG !
80 changes: 80 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
name: Release

on:
workflow_dispatch:
inputs:
title:
type: string
description: 'Title'
required: true
default: 'v0.00.0 R0'

jobs:
build-and-release:
runs-on: ubuntu-latest

permissions: write-all

steps:
- name: Checkout
env:
BRANCH: ${{ github.ref_name }}
run: |
mkdir -p "${{ github.workspace }}/stable"
git clone --no-checkout https://github.com/MaintainTeam/Hypatia.git .
git checkout --progress --force "stable"
- name: Set up JDK
uses: actions/setup-java@v4
with:
java-version: 17
distribution: "temurin"
cache: 'gradle'

- name: Build release APK
run: |
cd "${{ github.workspace }}/stable"
echo "::notice::building stable"
./gradlew assembleRelease
mv "${{ github.workspace }}/stable/app/build/outputs/apk/release/app-release-unsigned.apk" "${{ github.workspace }}/output/stable.apk"
cp "./.github/changelog.md" "${{ github.workspace }}/output/"
- name: Sign APK
env:
KEYSTORE: ${{ secrets.KEYSTORE }}
SIGNING_STORE_PASSWORD: ${{ secrets.SIGNING_STORE_PASSWORD }}
run: |
cd "${{ github.workspace }}/output/"
echo "${KEYSTORE}" | base64 -d > apksign.keystore
version=$( grep "versionName" "${{ github.workspace }}/stable/app/build.gradle" | awk -F'"' '{print $2}' )
${ANDROID_HOME}/build-tools/34.0.0/apksigner sign --ks apksign.keystore --ks-pass env:SIGNING_STORE_PASSWORD "./stable.apk"
mv "stable.apk" "hypatia_v${version}.apk"
echo ${version} > version.num
ls -la
- name: Generate checksum
run: |
cd "${{ github.workspace }}/output/"
find . -name '*.apk' -type f -exec sha256sum {} \; > checksums.txt
echo "::notice::$(echo $(cat ./checksums.txt))"
ls -la
- name: Create release and upload
run: |
gh auth login --with-token <<<"${{ secrets.GITHUB_TOKEN }}"
cd "${{ github.workspace }}/output/"
version=$(cat version.num)
echo $version
gh release create "v${version}" --title "${{ inputs.title }}" --notes-file "./changelog.md" --prerelease="true" --repo MaintainTeam/Hypatia
gh release upload "v${version}" $(echo $(find . -name '*.apk' -type f -exec basename \{} \;) checksums.txt) --repo MaintainTeam/Hypatia
- name: Archive reports for job
uses: actions/upload-artifact@v4
with:
name: reports
path: '*/build/reports'
if: ${{ always() }}

0 comments on commit 8e536fe

Please sign in to comment.