Skip to content

Compose Desktop Build #508

Compose Desktop Build

Compose Desktop Build #508

Workflow file for this run

name: Compose Desktop Build
env:
GITHUB_DEPLOY: 'false'
on:
push:
branches:
- main
tags:
- '*'
paths-ignore:
- LICENSE
- README.md
- 'docs/**'
- '.github/config/labels.yml'
pull_request:
branches:
- main
schedule:
- cron: "0 0 * * *"
workflow_dispatch:
repository_dispatch:
types: [ app-release ]
defaults:
run:
shell: bash
jobs:
build:
name: Build Package
timeout-minutes: 15
continue-on-error: false
# if: github.event_name == 'pull_request'
runs-on: ${{ matrix.os }}
strategy:
fail-fast: true
matrix:
os: [windows-latest, macos-latest, ubuntu-latest] # macos-latest, , arm64, ubuntu-latest
jdk: [ 19 ]
steps:
- name: Check out the source code
uses: actions/checkout@v3
- name: 'Set up latest JDK N from jdk.java.net'
uses: oracle-actions/setup-java@v1
with:
website: oracle.com
release: 21 # Replace N with GA, EA, 17, 18, 19, ...
# - name: Download ${{ matrix.os }} OpenJDK ${{ matrix.jdk }}
# id: download-jdk
# uses: sormuras/download-jdk@v1
# with:
# feature: ${{ matrix.jdk }}
#
# - name: Set up OpenJDK ${{ matrix.jdk }}
# id: setup-java
# uses: actions/setup-java@v3
# if: always() && steps.download-jdk.outcome == 'success'
# with:
# distribution: jdkfile
# java-version: ${{ env.JDK_VERSION }}
# jdkFile: ${{ env.JDK_FILE }}
- name: Cache Gradle dependencies
uses: actions/[email protected]
with:
path: |
~/.gradle/caches
~/.gradle/wrapper
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }}
restore-keys: |
${{ runner.os }}-gradle-
- name: Deploy to GitHub Packages (Linux)
id: gradle-deploy
if: env.GITHUB_DEPLOY == 'true' && runner.os == 'Linux'
run: |
./gradlew deploy
env:
GITHUB_USER: ${{ github.repository_owner }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Gradle Build
id: gradle-build
run: ./gradlew packageDistributionForCurrentOS
# - name: Uploading ${{ matrix.os }} package
# if: steps.gradle-build.outcome == 'success'
# uses: actions/upload-artifact@v3
# with:
# name: ${{ steps.gradle-build.outputs.uber_jar_name }}
# path: |
# ${{ steps.gradle-build.outputs.uber_jar_path }}
# if-no-files-found: error
# - name: Uploading ${{ matrix.os }} native package
# if: steps.gradle-build.outcome == 'success'
# uses: actions/upload-artifact@v3
# with:
# name: ${{ steps.gradle-build.outputs.app_pkg_name }}
# path: |
# ${{ steps.gradle-build.outputs.app_pkg_path }}
# if-no-files-found: error
- name: Publish Artifact
uses: actions/upload-artifact@v3
with:
name: MoreImages-${{ matrix.os }}.zip
path: |
build/compose/binaries/main/*/
build/compose/binaries/main-release/*/
build/compose/jars/
build/compose/binaries/main/app/
release:
name: Release new version.
needs: [ build ]
if: startsWith(github.ref, 'refs/tags/')
runs-on: ubuntu-latest
steps:
- name: Check out the source code
uses: actions/checkout@v3
with:
fetch-depth: 0
- uses: ffurrer2/[email protected]
id: extract_release_notes
if: ${{ false }}
- name: Build Changelog
id: github_release
uses: mikepenz/release-changelog-builder-action@v3
with:
configuration: ".github/config/configuration.json"
commitMode: true
ignorePreReleases: ${{ !contains(github.ref, '-') }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Download all the build artifacts
uses: actions/[email protected]
with:
path: release-artifacts
- name: Github Release
uses: softprops/action-gh-release@v1
with:
body: ${{ steps.github_release.outputs.changelog }}
prerelease: ${{ contains(github.event.inputs.version, '-rc') || contains(github.event.inputs.version, '-b') || contains(github.event.inputs.version, '-a') }}
files: |
${{ github.workspace }}/release-artifacts/MoreImages-*.zip
fail_on_unmatched_files: true
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}