mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-16 10:48:00 +00:00
Create snapshots-android.yml
This commit is contained in:
77
.github/workflows/snapshots-android.yml
vendored
Normal file
77
.github/workflows/snapshots-android.yml
vendored
Normal file
@@ -0,0 +1,77 @@
|
|||||||
|
name: Forge Snapshot
|
||||||
|
|
||||||
|
on:
|
||||||
|
workflow_dispatch:
|
||||||
|
inputs:
|
||||||
|
debug_enabled:
|
||||||
|
type: boolean
|
||||||
|
description: 'Run the build with tmate debugging enabled (https://github.com/marketplace/actions/debugging-with-tmate)'
|
||||||
|
required: false
|
||||||
|
default: false
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
build:
|
||||||
|
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
permissions:
|
||||||
|
contents: write
|
||||||
|
deployments: write
|
||||||
|
packages: write
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v3
|
||||||
|
- name: Set up JDK 8
|
||||||
|
uses: actions/setup-java@v3
|
||||||
|
with:
|
||||||
|
java-version: '8'
|
||||||
|
distribution: 'temurin'
|
||||||
|
cache: 'maven'
|
||||||
|
server-id: cardforge-repo
|
||||||
|
server-username: ${{ secrets.FTP_USERNAME }}
|
||||||
|
server-password: ${{ secrets.FTP_PASSWORD }}
|
||||||
|
settings-path: ${{ github.workspace }} # location for the settings.xml file
|
||||||
|
|
||||||
|
- name: Install android SDK
|
||||||
|
uses: maxim-lobanov/setup-android-tools@v1
|
||||||
|
with:
|
||||||
|
packages: |
|
||||||
|
platforms;android-26
|
||||||
|
build-tools;30.0.3
|
||||||
|
|
||||||
|
- name: Install virtual framebuffer (if not available) to allow running GUI on a headless server
|
||||||
|
run: |
|
||||||
|
command -v Xvfb >/dev/null 2>&1 || { sudo apt update && sudo apt install -y xvfb; }
|
||||||
|
export DISPLAY=":1"
|
||||||
|
Xvfb :1 -screen 0 800x600x8 &
|
||||||
|
|
||||||
|
- name: Extract Android keystore
|
||||||
|
run: |
|
||||||
|
echo "${{ secrets.FORGE_KEYSTORE }}" > forge.keystore.asc
|
||||||
|
gpg -d -passphrase "${{ secrets.FORGE_KEYSTORE_PASSPHRASE }}" --batch forge.keystore.asc > forge.keystore
|
||||||
|
|
||||||
|
- name: Configure Git User
|
||||||
|
run: |
|
||||||
|
git config user.email "actions@github.com"
|
||||||
|
git config user.name "GitHub Actions"
|
||||||
|
|
||||||
|
- name: maven clean install
|
||||||
|
run: |
|
||||||
|
mvn clean install -Dmaven.test.skip=true
|
||||||
|
|
||||||
|
- name: Setup tmate session
|
||||||
|
uses: mxschmitt/action-tmate@v3
|
||||||
|
if: ${{ github.event_name == 'workflow_dispatch' && inputs.debug_enabled }}
|
||||||
|
|
||||||
|
- name: Install Android maven plugin
|
||||||
|
run: |
|
||||||
|
mkdir -p ~/.m2/repository/com/simpligility/maven/plugins/android-maven-plugin/4.6.1
|
||||||
|
cd ~/.m2/repository/com/simpligility/maven/plugins/android-maven-plugin/4.6.1
|
||||||
|
curl -L -o android-maven-plugin-4.6.1.jar https://github.com/Card-Forge/android-maven-plugin/releases/download/4.6.1/android-maven-plugin-4.6.1.jar
|
||||||
|
curl -L -o android-maven-plugin-4.6.1.pom https://github.com/Card-Forge/android-maven-plugin/releases/download/4.6.1/android-maven-plugin-4.6.1.pom
|
||||||
|
cd -
|
||||||
|
|
||||||
|
- name: Build/Install/Publish to GitHub Packages Apache Maven
|
||||||
|
run: |
|
||||||
|
mvn -U -B -P android-release-build,android-release-sign install -e -Dsign.keystore=forge.keystore -Dsign.alias=Forge -Dsign.storepass=${{ secrets.SIGN_STORE_PASS }} -Dsign.keypass=${{ secrets.SIGN_KEY_PASS }} -Dcardforge-repo.username=${{ secrets.FTP_USERNAME }} -Dcardforge-repo.password=${{ secrets.FTP_PASSWORD }} -Dandroid.sdk.path=/usr/local/lib/android/sdk
|
||||||
|
env:
|
||||||
|
GITHUB_TOKEN: ${{ github.token }}
|
||||||
Reference in New Issue
Block a user