diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..f2d098d --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,50 @@ +name: Release +on: + push: + tags: + - v* + +jobs: + build: + runs-on: ubuntu-latest + + steps: + - name: Checkout builds + uses: actions/checkout@main + + - name: Setup JDK 11 + uses: actions/setup-java@main + with: + java-version: 11 + + - name: Setup Android SDK + uses: android-actions/setup-android@7c5672355aaa8fde5f97a91aa9a99616d1ace6bc # v2.0.10 + + - name: Setup credentials + run: | + base64 -d <<< "$KEYSTORE_BASE64" > $HOME/keystore.jks + + mkdir -p ~/.gradle + cat > ~/.gradle/gradle.properties << EOF + KEYSTORE_FILE=$HOME/keystore.jks + KEYSTORE_ALIAS=$KEYSTORE_ALIAS + KEYSTORE_PASSWORD=$KEYSTORE_PASSWORD + EOF + env: + KEYSTORE_BASE64: ${{ secrets.KEYSTORE_BASE64 }} + KEYSTORE_ALIAS: ${{ secrets.KEYSTORE_ALIAS }} + KEYSTORE_PASSWORD: ${{ secrets.KEYSTORE_PASSWORD }} + + - name: Get some values needed for the release + id: release_values + run: | + echo "release_tag=${GITHUB_REF#refs/tags/}" >> $GITHUB_ENV + + - name: Build + run: | + chmod +x ./gradlew + ./gradlew app:assembleRelease + mv app/build/outputs/apk/release/app-release.apk Vencord-$TAG.apk + gh release create $TAG --generate-notes --title "Vencord $TAG" Vencord-$TAG.apk + env: + TAG: ${{ env.release_tag }}