Skip to content

Update gradle_snapshot_build.yml #34

Update gradle_snapshot_build.yml

Update gradle_snapshot_build.yml #34

# This workflow uses actions that are not certified by GitHub.
# They are provided by a third-party and are governed by
# separate terms of service, privacy policy, and support
# documentation.
# This workflow will build a package using Gradle and then publish it to GitHub packages when a release is created
# For more information see: https://github.com/actions/setup-java/blob/main/docs/advanced-usage.md#Publishing-using-gradle
name: Gradle Snapshot Build
on:
workflow_dispatch:
push:
jobs:
build:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
ref: update_build_script
- name: Set up JDK 17
uses: actions/setup-java@v4
with:
java-version: '17'
distribution: 'temurin'
# Configure Gradle for optimal use in GitHub Actions, including caching of downloaded dependencies.
# See: https://github.com/gradle/actions/blob/main/setup-gradle/README.md
- name: Setup Gradle
uses: gradle/actions/setup-gradle@af1da67850ed9a4cedd57bfd976089dd991e2582 # v4.0.0
- name: PublishToMavenLocal
run: |
git describe --abbrev=0 --tags
# git describe --tags
# ./gradlew :gallery:assembleRelease
# ./gradlew publishDesktopPublicationToMavenLocal
# ./gradlew publishAndroidReleasePublicationToMavenLocal
env:
OSSRH_USERNAME: ${{ secrets.OSSRH_USERNAME }}
OSSRH_PASSWORD: ${{ secrets.OSSRH_PASSWORD }}
SIGNING_KEY_ID: ${{ secrets.SIGNING_KEY_ID }}
SIGNING_KEY: ${{ secrets.SIGNING_KEY }}
SIGNING_PASSWORD: ${{ secrets.SIGNING_PASSWORD }}
- name: Build Gallery Android
run: |
echo "$ANDROID_KEYSTORE" | base64 --decode > ${{ github.workspace }}/android_sign_key.jks
./gradlew :gallery:assembleRelease
env:
ANDROID_KEYSTORE: ${{ secrets.ANDROID_KEYSTORE }}
ANDROID_SIGNING_FILE: ${{ github.workspace }}/android_sign_key.jks
ANDROID_SIGNING_PASSWORD: ${{ secrets.KEYSTORE_PASSWORD }}
ANDROID_SIGNING_KEY_ALIAS: ${{ secrets.KEY_ALIAS }}
ANDROID_SIGNING_KEY_PASSWORD: ${{ secrets.KEY_PASSWORD }}
- name: Upload build artifacts
uses: actions/upload-artifact@v4
with:
name: Artifact-${{ github.run_id }}
path: |
~/.m2/repository
${{github.workspace}}/gallery/**/*.apk