IdelsTak / meta-data

Effortlessly manage MP3 tags. Fetch, review, edit & save accurate information for your music library.
MIT License
1 stars 0 forks source link

Automate release builds for all major platforms using GitHub actions #17

Open IdelsTak opened 6 days ago

IdelsTak commented 6 days ago

Description:

We need to set up GitHub Actions to automatically create releases with builds for all major platforms upon successful merges to the master branch. This will streamline our release process and ensure that we consistently provide up-to-date binaries for our users.

Requirements:

  1. Set Up GitHub Actions Workflow:
    • Trigger on successful merges to the master branch.
    • Build the project for all major platforms: Windows, macOS, and Linux.
  2. Build Configuration:
    • Ensure the build process includes all necessary dependencies and configurations for each platform.
    • Optimize the build process to minimize time and resource usage.
  3. Automate Release Creation:
    • Automatically create a new release on GitHub.
    • Include build artifacts (binaries) for each platform in the release.
    • Tag the release with the appropriate version number.
  4. Testing:
    • Implement steps to run tests on each build to ensure stability and correctness before creating the release.

Example Workflow Snippet:

name: Build and Release

on:
  push:
    branches:
      - release

jobs:
  build:
    runs-on: ${{ matrix.os }}
    strategy:
      matrix:
        os: [ubuntu-latest, macos-latest, windows-latest]

    steps:
    - name: Checkout code
      uses: actions/checkout@v2

    - name: Set up JDK
      uses: actions/setup-java@v2
      with:
        distribution: 'adopt'
        java-version: '11'

    - name: Build
      run: ./gradlew build

    - name: Package and upload artifacts
      run: |
        mkdir -p release
        cp build/libs/*.jar release/
      uses: actions/upload-artifact@v2
      with:
        name: ${{ matrix.os }}-build
        path: release

  release:
    needs: build
    runs-on: ubuntu-latest
    steps:
    - name: Download build artifacts
      uses: actions/download-artifact@v2
      with:
        name: build
        path: ./release

    - name: Create Release
      id: create_release
      uses: actions/create-release@v1
      env:
        GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
      with:
        tag_name: v1.0.0
        release_name: Release v1.0.0
        draft: false
        prerelease: false

    - name: Upload Release Asset
      uses: actions/upload-release-asset@v1
      env:
        GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
      with:
        upload_url: ${{ steps.create_release.outputs.upload_url }}
        asset_path: ./release/*.jar
        asset_name: my-app.jar
        asset_content_type: application/java-archive

Important Note

Current Release Runs on Linux Only

The current release (metadata-1.0.0-beta.2) was built on a Linux computer, which means it includes only the Linux-specific artifacts of JavaFX. As a result, attempting to run this release on Windows results in the following error:

WARNING: Unsupported JavaFX configuration: classes were loaded from 'unnamed module @77ec78b9'
Error initializing QuantumRenderer: no suitable pipeline found
java.lang.RuntimeException: Error initializing QuantumRenderer: no suitable pipeline found
...
Exception in thread "main" java.lang.RuntimeException: No toolkit found
...

windows-javafx-error-2024-07-04_18-17

To resolve this issue, we need to include JavaFX artifacts for all major platforms (Windows, macOS, and Linux) in our release builds.