Create Desktop Snapshot #13
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: Create Desktop 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 | |
schedule: | |
# * is a special character in YAML so you have to quote this string | |
- cron: '30 18 * * *' | |
jobs: | |
build: | |
if: github.repository_owner == 'Card-Forge' | |
runs-on: ubuntu-latest | |
permissions: | |
contents: write | |
deployments: write | |
packages: write | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Set up JDK 11 | |
uses: actions/setup-java@v3 | |
with: | |
java-version: '11' | |
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 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; } | |
- name: Configure Git User | |
run: | | |
git config user.email "actions@github.com" | |
git config user.name "GitHub Actions" | |
- name: Build/Install Snapshot | |
run: | | |
export DISPLAY=":1" | |
Xvfb :1 -screen 0 800x600x8 & | |
mvn -U -B clean -P windows-linux install -T 1C -Dcardforge-repo.username=${{ secrets.FTP_USERNAME }} -Dcardforge-repo.password=${{ secrets.FTP_PASSWORD }} | |
env: | |
GITHUB_TOKEN: ${{ github.token }} | |
- name: Setup tmate session | |
uses: mxschmitt/action-tmate@v3 | |
if: ${{ github.event_name == 'workflow_dispatch' && inputs.debug_enabled }} | |
- name: Rename before upload | |
run: | | |
mkdir tarball | |
# If this works just gotta figure out how to append datetime | |
mv /home/runner/.m2/repository/forge/forge-gui-desktop/*/*.bz2 tarball/ | |
cd tarball | |
out="$(basename -s .tar.bz2 *)" | |
d=$(date +%m-%d) | |
mv "${out}.tar.bz2" "${out}-${d}.tar.bz2" | |
- name: 📂 Sync files | |
uses: SamKirkland/FTP-Deploy-Action@v4.3.4 | |
with: | |
server: ftp.cardforge.org | |
username: ${{ secrets.FTP_USERNAME }} | |
password: ${{ secrets.FTP_PASSWORD }} | |
local-dir: tarball/ | |
server-dir: downloads/dailysnapshots/ | |
exclude: | | |
*.jar | |
*.pom | |
*.repositories | |
*.xml | |