mirror of
https://github.com/ImranR98/Obtainium.git
synced 2025-10-29 20:43:28 +01:00
Updated GitHub actions
This commit is contained in:
@@ -1,4 +1,4 @@
|
|||||||
name: android
|
name: Release (Manual/Draft)
|
||||||
|
|
||||||
on:
|
on:
|
||||||
workflow_dispatch:
|
workflow_dispatch:
|
||||||
@@ -25,12 +25,16 @@ jobs:
|
|||||||
env:
|
env:
|
||||||
KEYSTORE_BASE64: ${{ secrets.KEYSTORE_BASE64 }}
|
KEYSTORE_BASE64: ${{ secrets.KEYSTORE_BASE64 }}
|
||||||
KEYSTORE_PASS: ${{ secrets.KEYSTORE_PASS }}
|
KEYSTORE_PASS: ${{ secrets.KEYSTORE_PASS }}
|
||||||
|
GPG_KEY: ${{ secrets.GPG_KEY }}
|
||||||
run: |
|
run: |
|
||||||
echo "${KEYSTORE_BASE64}" | base64 -d > apksign.keystore
|
echo "${KEYSTORE_BASE64}" | base64 -d > apksign.keystore
|
||||||
|
echo "$GPG_KEY" | gpg --import
|
||||||
for apk in ./build/app/outputs/flutter-apk/*-release*.apk; do
|
for apk in ./build/app/outputs/flutter-apk/*-release*.apk; do
|
||||||
out=${apk/-release/-release-signed}
|
unsignedFn=${apk/-release/-unsigned}
|
||||||
${ANDROID_HOME}/build-tools/30.0.2/apksigner sign --ks apksign.keystore --ks-pass env:KEYSTORE_PASS --out "${out}" "${apk}"
|
mv "$apk" "$unsignedFn"
|
||||||
echo "$(sha256sum ${out})"
|
${ANDROID_HOME}/build-tools/30.0.2/apksigner sign --ks apksign.keystore --ks-pass env:KEYSTORE_PASS --out "${apk}" "${unsignedFn}"
|
||||||
|
sha256sum ${apk} | cut -d " " -f 1 > "$apk".sha256
|
||||||
|
gpg --sign --detach-sig "$apk".sha256
|
||||||
done
|
done
|
||||||
rm apksign.keystore
|
rm apksign.keystore
|
||||||
|
|
||||||
@@ -39,14 +43,19 @@ jobs:
|
|||||||
run: |
|
run: |
|
||||||
VERSION=$(grep -oP "currentVersion = '\K[^']+" lib/main.dart)
|
VERSION=$(grep -oP "currentVersion = '\K[^']+" lib/main.dart)
|
||||||
echo "::set-output name=version::$VERSION"
|
echo "::set-output name=version::$VERSION"
|
||||||
|
TAG=$(grep -oP "'.*\\\$currentVersion.*'" lib/main.dart | head -c -2 | tail -c +2 | sed "s/\$currentVersion/$VERSION/g")
|
||||||
|
echo "::set-output name=tag::$TAG"
|
||||||
|
if [ -n "$(echo $TAG | grep -oP '\-beta$')" ]; then BETA=true; else BETA=false; fi
|
||||||
|
echo "::set-output name=beta::$BETA"
|
||||||
|
|
||||||
- name: Create Release And Upload APKs
|
- name: Create Release And Upload APKs
|
||||||
uses: ncipollo/release-action@v1
|
uses: ncipollo/release-action@v1
|
||||||
with:
|
with:
|
||||||
token: ${{ secrets.GAT }}
|
token: ${{ secrets.GAT }}
|
||||||
tag: "v${{ steps.extract_version.outputs.version }}-beta"
|
tag: "${{ steps.extract_version.outputs.tag }}"
|
||||||
prerelease: true
|
prerelease: "${{ steps.extract_version.outputs.beta }}"
|
||||||
artifacts: ./build/app/outputs/flutter-apk/*-signed*.apk
|
artifacts: ./build/app/outputs/flutter-apk/*-release*.apk*
|
||||||
|
draft: true
|
||||||
|
|
||||||
- name: Archive Reports For Job
|
- name: Archive Reports For Job
|
||||||
uses: actions/upload-artifact@v3
|
uses: actions/upload-artifact@v3
|
||||||
Reference in New Issue
Block a user