Skip to content

Commit

Permalink
Adapt workflows
Browse files Browse the repository at this point in the history
  • Loading branch information
adanski committed Dec 4, 2023
1 parent c6081cc commit cf6de5d
Show file tree
Hide file tree
Showing 7 changed files with 65 additions and 70 deletions.
1 change: 0 additions & 1 deletion .github/CODE_OF_CONDUCT.md

This file was deleted.

1 change: 0 additions & 1 deletion .github/CONTRIBUTING.md

This file was deleted.

2 changes: 0 additions & 2 deletions .github/FUNDING.yml

This file was deleted.

23 changes: 0 additions & 23 deletions .github/dependabot.yml

This file was deleted.

43 changes: 34 additions & 9 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -1,32 +1,57 @@
name: Build
# This workflow will build the APK using JDK when a commit is pushed or a pull request is opened

name: build

on:
push:
branches:
- master
pull_request:
workflow_dispatch:
workflow_call:

jobs:
Build:
build:
runs-on: ubuntu-latest

steps:
- name: Checkout Repository
- name: Checkout
uses: actions/checkout@v3

- name: Set-up JDK 11
- name: Setup JDK 11
uses: actions/setup-java@v3
with:
java-version: '11'
distribution: 'temurin'

- name: Setup and build with Gradle
- name: Prepare for signing
run: |
echo "${{secrets.RELEASE_KEYSTORE}}" > infinity.jks.asc
gpg -d --passphrase "${{secrets.RELEASE_KEYSTORE_PASSPHRASE}}" --batch infinity.jks.asc > ${{github.workspace}}/infinity.jks
- name: Build with Gradle
uses: gradle/gradle-build-action@v2
with:
arguments: build -x lint
arguments: >
assembleMinifiedRelease
-Pandroid.injected.signing.store.file=${{github.workspace}}/infinity.jks
-Pandroid.injected.signing.store.password=${{secrets.RELEASE_KEYSTORE_PW}}
-Pandroid.injected.signing.key.alias=adanski-infinity
-Pandroid.injected.signing.key.password=${{secrets.RELEASE_KEYSTORE_PW}}
- name: Rename APK and generate checksum
run: |
cd app/build/outputs/apk/minifiedRelease
find -name "*.apk" -exec mv '{}' infinity-personal-${{github.ref_name}}.apk \; -quit
sha256sum infinity-personal-${{github.ref_name}}.apk > infinity-personal-${{github.ref_name}}.apk.sha256
cd ${{github.workspace}}
- name: Upload apk
- name: Upload APK
uses: actions/upload-artifact@v3
with:
name: Infinity-${{github.sha}}
path: app/build/outputs/apk/
name: infinity-personal-${{github.ref_name}}
path: |
app/build/outputs/apk/minifiedRelease/*.apk
app/build/outputs/apk/minifiedRelease/*.apk.sha256
if-no-files-found: error
retention-days: 7
34 changes: 0 additions & 34 deletions .github/workflows/codeql-analysis.yml

This file was deleted.

31 changes: 31 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# This workflow will publish the APK as a GitHub release

name: publish

on:
push:
tags:
- 'v[0-9]+.[0-9]+.[0-9]+'
workflow_dispatch:

jobs:
build:
uses: ./.github/workflows/build.yml
secrets: inherit
publish-gh:
runs-on: ubuntu-latest

needs: build
steps:
- name: Download APK
uses: actions/download-artifact@v3
with:
name: infinity-personal-${{github.ref_name}}

- name: Release
uses: softprops/action-gh-release@v1
with:
body: See https://github.com/Docile-Alligator/Infinity-For-Reddit/releases/tag/${{github.ref_name}}
files: |
infinity-personal-${{github.ref_name}}.apk
infinity-personal-${{github.ref_name}}.apk.sha256

0 comments on commit cf6de5d

Please sign in to comment.