Skip to content

Commit

Permalink
Create main.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
jakepurple13 authored Apr 22, 2024
1 parent 3d43dad commit 6da2839
Showing 1 changed file with 111 additions and 0 deletions.
111 changes: 111 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,111 @@
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

workflow_dispatch:
repository_dispatch:
types: [ app-release ]

defaults:
run:
shell: bash

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
build:
name: Build Package
timeout-minutes: 15
continue-on-error: true
# if: github.event_name == 'pull_request'

runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ ubuntu-latest, macos-latest, windows-latest ]
jdk: [ 18 ]

steps:
- name: Check out the source code
uses: actions/checkout@v3

- name: Setup JDK
uses: actions/setup-java@v3
with:
distribution: adopt
java-version: 18

- 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: Gradle Build
id: gradle-build
run: ./gradlew createDistributable

- name: Archive Artifacts
uses: actions/upload-artifact@v3
with:
name: distributable-${{ matrix.os }}
if-no-files-found: ignore
path: |
desktop/build/**/*.dmg
desktop/build/**/*.app
desktop/build/**/*.deb
desktop/build/**/*.msi
desktop/build/**/*.exe
desktop/build/compose/jars/*.jar
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

- name: Download all the build artifacts
uses: actions/download-artifact@v3
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/**
fail_on_unmatched_files: true
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

0 comments on commit 6da2839

Please sign in to comment.