From 21ff9cbd78eac6433e9f3d03a758d7a04a902b07 Mon Sep 17 00:00:00 2001 From: erfur Date: Tue, 27 Feb 2024 17:41:00 +0100 Subject: [PATCH] CI draft --- .github/workflows/build.yml | 55 +++++++++++++++++++++++++++++++++++++ 1 file changed, 55 insertions(+) create mode 100644 .github/workflows/build.yml diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 0000000..9b2b836 --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,55 @@ +# This is a basic workflow to help you get started with Actions + +name: CI + +# Controls when the workflow will run +on: + # Triggers the workflow on push or pull request events but only for the "main" branch + push: + branches: ["main"] + tags: + - "*" + pull_request: + branches: ["main"] + + # Allows you to run this workflow manually from the Actions tab + workflow_dispatch: + +permissions: + contents: write + +# A workflow run is made up of one or more jobs that can run sequentially or in parallel +jobs: + modify_and_release_apk: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v4 + + - name: Setup tmate session + uses: mxschmitt/action-tmate@v3 + + - name: rename files + run: | + mv obsidian.apk "${{ env.NEW_APK_NAME }}.apk" + mv ./obsidian/dist/obsidian.apk "./${{ env.NEW_APK_NAME }}-hooked-unsigned.apk" + mv "${{ steps.sign_app.outputs.signedReleaseFile }}" "${{ env.NEW_APK_NAME }}-hooked-signed.apk" + + - name: save hashes in env + run: | + echo '```' > hashes.txt + echo "SHA256 hashes:" >> hashes.txt + sha256sum "${{ env.NEW_APK_NAME }}.apk" >> hashes.txt + sha256sum "${{ env.NEW_APK_NAME }}-hooked-unsigned.apk" >> hashes.txt + sha256sum "${{ env.NEW_APK_NAME }}-hooked-signed.apk" >> hashes.txt + echo '```' >> hashes.txt + + - name: release + uses: softprops/action-gh-release@v1 + if: startsWith(github.ref, 'refs/tags/') + with: + body_path: hashes.txt + files: | + ./${{ env.NEW_APK_NAME }}.apk + ./${{ env.NEW_APK_NAME }}-hooked-unsigned.apk + ./${{ env.NEW_APK_NAME }}-hooked-signed.apk