mirror of
https://github.com/MaintainTeam/Hypatia.git
synced 2025-02-28 21:38:21 +03:00
ci: create release file
This commit is contained in:
parent
8c53d09029
commit
c81eb4f258
2 changed files with 82 additions and 0 deletions
1
.github/changelog.md
vendored
Normal file
1
.github/changelog.md
vendored
Normal file
|
@ -0,0 +1 @@
|
||||||
|
- THIS IS A PRE-RELEASE/RELEASE OUTPUT BY GITHUB ACTIONS - WAIT MAINTAINER/AUTHOR TO UPDATE THIS CHANGELOG !
|
81
.github/workflows/release.yml
vendored
Normal file
81
.github/workflows/release.yml
vendored
Normal file
|
@ -0,0 +1,81 @@
|
||||||
|
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"
|
||||||
|
cd "${{ 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() }}
|
Loading…
Add table
Reference in a new issue