-
Notifications
You must be signed in to change notification settings - Fork 0
162 lines (140 loc) · 4.58 KB
/
build.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
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 }}