chore(deps): 更新依赖版本 #129
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Dev Builds | |
on: | |
push: | |
branches: | |
- develop | |
workflow_dispatch: | |
inputs: | |
name: | |
description: "Dev-Build" | |
default: "Generate dev build" | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout Repository | |
uses: actions/checkout@v4 | |
- name: Setup Java | |
uses: actions/setup-java@v4 | |
with: | |
distribution: 'temurin' | |
java-version: 17 | |
cache: 'gradle' | |
- name: Setup Android SDK | |
uses: android-actions/setup-android@v3 | |
- name: Set up gradle | |
uses: gradle/actions/setup-gradle@v3 | |
- name: Decode Keystore | |
env: | |
ENCODED_STRING: ${{ secrets.KEYSTORE_BASE_64 }} | |
RELEASE_KEYSTORE_PASSWORD: ${{ secrets.RELEASE_KEYSTORE_PASSWORD }} | |
RELEASE_KEYSTORE_ALIAS: ${{ secrets.RELEASE_KEYSTORE_ALIAS }} | |
RELEASE_KEY_PASSWORD: ${{ secrets.RELEASE_KEY_PASSWORD }} | |
run: | | |
echo ${{ github.ref }} | |
echo $ENCODED_STRING > keystore-b64.txt | |
base64 -d keystore-b64.txt > pipixiv.jks | |
- name: Add Google Services | |
env: | |
GOOGLE_SERVICE_JSON: ${{ secrets.GOOGLE_SERVICES_JSON }} | |
run: | | |
echo $GOOGLE_SERVICE_JSON > app/google-services.json | |
- name: Build Foss Release apk | |
env: | |
RELEASE_KEYSTORE_PASSWORD: ${{ secrets.RELEASE_KEYSTORE_PASSWORD }} | |
RELEASE_KEYSTORE_ALIAS: ${{ secrets.RELEASE_KEYSTORE_ALIAS }} | |
RELEASE_KEY_PASSWORD: ${{ secrets.RELEASE_KEY_PASSWORD }} | |
run: ./gradlew assembleFossRelease -PapplyFirebasePlugins=false --stacktrace | |
- name: Build Default Release apk | |
env: | |
RELEASE_KEYSTORE_PASSWORD: ${{ secrets.RELEASE_KEYSTORE_PASSWORD }} | |
RELEASE_KEYSTORE_ALIAS: ${{ secrets.RELEASE_KEYSTORE_ALIAS }} | |
RELEASE_KEY_PASSWORD: ${{ secrets.RELEASE_KEY_PASSWORD }} | |
run: ./gradlew assembleDefaultRelease -PapplyFirebasePlugins=true --stacktrace | |
- name: Get release file apk path | |
id: releaseApks | |
run: | | |
RELEASE_APKS=$(find app/build/outputs/apk/*/release/*.apk) | |
echo "Found APKs:" | |
echo "$RELEASE_APKS" | |
delimiter="|" | |
echo "release_apks<<$delimiter" >> $GITHUB_OUTPUT | |
echo "$RELEASE_APKS" >> $GITHUB_OUTPUT | |
echo "$delimiter" >> $GITHUB_OUTPUT | |
- name: Upload Release Build to Artifacts | |
uses: actions/upload-artifact@v4 | |
with: | |
name: release-apks | |
path: ${{ steps.releaseApks.outputs.release_apks }} | |
- name: Get tag name | |
if: startsWith(github.ref, 'refs/tags/v') | |
run: | | |
set -x | |
echo "VERSION_TAG=${GITHUB_REF/refs\/tags\//}" >> $GITHUB_ENV | |
- name: Create Release | |
if: startsWith(github.ref, 'refs/tags/v') | |
id: create_release | |
uses: softprops/action-gh-release@v2 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }} | |
with: | |
tag_name: ${{ env.VERSION_TAG }} | |
name: PiPixiv ${{ env.VERSION_TAG }} | |
body: | | |
Release ${{ env.VERSION_TAG }} | |
draft: true | |
prerelease: false | |
files: | | |
${{ steps.releaseApks.outputs.release_apks }} | |