Update action.yml #136
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: build | ||
on: | ||
push: | ||
branches: [ "*" ] | ||
pull_request: | ||
branches: [ "*" ] | ||
jobs: | ||
desktop: | ||
name: Build Desktop Bundles | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
with: | ||
ref: '${{ github.ref }}' | ||
- name: Setup Java | ||
uses: actions/setup-java@v4 | ||
with: | ||
distribution: temurin | ||
java-version: 17 | ||
- name: Setup Python | ||
uses: actions/setup-python@v5 | ||
with: | ||
python-version: '3.x' | ||
- name: Install Python dependencies | ||
run: | | ||
python3 -m pip install --upgrade pip | ||
python3 -m pip install lxml | ||
- name: Grant execute permission for gradlew | ||
run: chmod +x gradlew | ||
- name: Build Desktop Bundles with Gradle | ||
run: ./gradlew -c settings.desktop.gradle buildAllBundles --no-configuration-cache | ||
- name: Verify dist directory | ||
id: verify-dist | ||
run: | | ||
if [ -d dist ] && [ "$(ls -A dist)" ]; then | ||
echo "dist directory exists and is not empty" | ||
else | ||
echo "dist directory is empty or does not exist" | ||
exit 1 | ||
fi | ||
- name: List Desktop Bundles | ||
id: list-bundles | ||
run: | | ||
echo "Bundles found:" | ||
ls -1 dist/ | ||
bundles=$(ls -1 dist/ | jq -R -s -c 'split("\n") | select(length > 0)') | ||
echo "Bundles array: $bundles" | ||
printf "bundles=%s\n" "$bundles" >> $GITHUB_OUTPUT | ||
if [ $? -ne 0 ]; then | ||
echo "jq command failed" | ||
exit 1 | ||
fi | ||
- name: Upload dist directory | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: dist | ||
path: dist/ | ||
- name: Debug bundles output | ||
run: echo "bundles output: ${{ steps.list-bundles.outputs.bundles }}" | ||
upload-desktop: | ||
name: Upload Desktop Bundles | ||
needs: desktop | ||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
bundle: ${{ fromJson(needs.desktop.outputs.bundles) }} | ||
steps: | ||
- name: Download dist directory | ||
uses: actions/download-artifact@v4 | ||
with: | ||
name: dist | ||
path: dist | ||
- name: Debug matrix | ||
run: echo "Matrix bundle: ${{ matrix.bundle }}" | ||
- name: Upload Desktop Bundle | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: ${{ matrix.bundle }} | ||
path: dist/${{ matrix.bundle }} |