-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
3d43dad
commit 6da2839
Showing
1 changed file
with
111 additions
and
0 deletions.
There are no files selected for viewing
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
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 }} |