Skip to content

Add keyboard shortcuts via hidden menu bars and improve "Request" men… #29

Add keyboard shortcuts via hidden menu bars and improve "Request" men…

Add keyboard shortcuts via hidden menu bars and improve "Request" men… #29

name: Package and release the zip
on:
push:
branches: [ main ]
jobs:
build-and-release:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- uses: graalvm/setup-graalvm@v1
with:
java-version: '17'
distribution: 'graalvm-community'
github-token:
${{ secrets.GITHUB_TOKEN }}
- name: Make scripts executable
run: |
chmod +x package.sh
- name: Run package script
run: ./package.sh
- name: List created files
run: ls -la dist/
- name: Test package
run: |
# Extract the package name from the output
PACKAGE_NAME=$(ls dist/*.zip | head -1 | xargs basename)
echo "Package name: $PACKAGE_NAME"
# Unzip the package to test it
mkdir -p test_package
unzip -q "dist/$PACKAGE_NAME" -d test_package
# Find the extracted directory
EXTRACTED_DIR=$(ls test_package)
echo "Extracted directory: $EXTRACTED_DIR"
# Verify the package structure
echo "Verifying package structure..."
# Check if the run script exists
if [ ! -f "test_package/$EXTRACTED_DIR/run.sh" ]; then
echo "Error: run.sh script not found in the package"
exit 1
fi
# Check if the JAR file exists
JAR_FILES=$(find "test_package/$EXTRACTED_DIR" -name "*.jar" | wc -l)
if [ "$JAR_FILES" -eq 0 ]; then
echo "Error: No JAR files found in the package"
exit 1
fi
# Check if the lib directory exists with JavaFX modules
if [ ! -d "test_package/$EXTRACTED_DIR/lib" ]; then
echo "Error: lib directory not found in the package"
exit 1
fi
# Make the run script executable
chmod +x "test_package/$EXTRACTED_DIR/run.sh"
# Check if the run script contains the expected content
if ! grep -q "Starting Swaggerific" "test_package/$EXTRACTED_DIR/run.sh"; then
echo "Error: run.sh does not contain expected content"
exit 1
fi
echo "Package structure verification successful!"
- name: Create Release
id: create_release
uses: softprops/action-gh-release@v1
if: startsWith(github.ref, 'refs/tags/')
with:
files: dist/*.zip
draft: false
prerelease: false
- name: Upload as artifact (for non-tag pushes)
uses: actions/upload-artifact@v4
if: "!startsWith(github.ref, 'refs/tags/')"
with:
name: swaggerific-zip
path: dist/*.zip
- name: Create automatic release (for non-tag pushes)
uses: "marvinpinto/action-automatic-releases@latest"
if: "!startsWith(github.ref, 'refs/tags/')"
with:
repo_token: "${{ secrets.GITHUB_TOKEN }}"
automatic_release_tag: "latest"
prerelease: true
title: "Latest Development Zip Package"
files: |
dist/*.zip