Skip to content

Commit 50eef11

Browse files
authored
Run workflow jobs toghether (#371)
* Run scripts in parallel * Re enable deb package builds
1 parent ed18012 commit 50eef11

File tree

3 files changed

+265
-74
lines changed

3 files changed

+265
-74
lines changed

.github/workflows/build_push.yml

+127-32
Original file line numberDiff line numberDiff line change
@@ -9,28 +9,26 @@ jobs:
99
check_wrapper:
1010
name: Validate Gradle Wrapper
1111
runs-on: ubuntu-latest
12-
1312
steps:
1413
- name: Clone repo
15-
uses: actions/checkout@v2
14+
uses: actions/checkout@v3
1615

1716
- name: Validate Gradle Wrapper
1817
uses: gradle/wrapper-validation-action@v1
1918

2019
build:
21-
name: Build artifacts and deploy preview
20+
name: Build Jar
2221
needs: check_wrapper
2322
if: "!startsWith(github.event.head_commit.message, '[SKIP CI]')"
2423
runs-on: ubuntu-latest
25-
2624
steps:
2725
- name: Cancel previous runs
28-
uses: styfle/cancel-workflow-action@0.9.0
26+
uses: styfle/cancel-workflow-action@0.10.0
2927
with:
3028
access_token: ${{ github.token }}
3129

3230
- name: Checkout master branch
33-
uses: actions/checkout@v2
31+
uses: actions/checkout@v3
3432
with:
3533
ref: master
3634
path: master
@@ -59,41 +57,138 @@ jobs:
5957
dependencies-cache-enabled: true
6058
configuration-cache-enabled: true
6159

60+
- name: Upload Jar
61+
uses: actions/upload-artifact@v3
62+
with:
63+
name: jar
64+
path: master/server/build/*.jar
65+
if-no-files-found: error
66+
67+
- name: Upload icons
68+
uses: actions/upload-artifact@v3
69+
with:
70+
name: icon
71+
path: master/server/src/main/resources/icon
72+
if-no-files-found: error
73+
74+
- name: Tar scripts dir to maintain file permissions
75+
run: tar -cvzf scripts.tar.gz -C master/ scripts/
76+
- name: Upload scripts.tar.gz
77+
uses: actions/upload-artifact@v3
78+
with:
79+
name: scripts
80+
path: scripts.tar.gz
81+
if-no-files-found: error
82+
83+
bundle:
84+
strategy:
85+
fail-fast: false
86+
matrix:
87+
os:
88+
- linux-x64
89+
- linux-all
90+
- macOS-x64
91+
- macOS-arm64
92+
- debian-all
93+
- windows-x64
94+
- windows-x86
95+
96+
name: Make ${{ matrix.os }} release
97+
needs: build
98+
runs-on: ubuntu-latest
99+
steps:
100+
- name: Download Jar
101+
uses: actions/download-artifact@v3
102+
with:
103+
name: jar
104+
path: server/build
105+
106+
- name: Download icons
107+
uses: actions/download-artifact@v3
108+
with:
109+
name: icon
110+
path: server/src/main/resources/icon
111+
112+
- name: Download scripts.tar.gz
113+
uses: actions/download-artifact@v3
114+
with:
115+
name: scripts
116+
117+
- name: Make ${{ matrix.os }} release
118+
run: |
119+
mkdir upload
120+
tar -xvpf scripts.tar.gz
121+
scripts/bundler.sh -o upload/ ${{ matrix.os }}
122+
123+
- name: Upload ${{ matrix.os }} release
124+
uses: actions/upload-artifact@v3
125+
with:
126+
name: ${{ matrix.os }}
127+
path: upload/*
128+
if-no-files-found: error
129+
130+
release:
131+
needs: bundle
132+
runs-on: ubuntu-latest
133+
steps:
134+
- uses: actions/download-artifact@v3
135+
with:
136+
name: jar
137+
path: release
138+
- uses: actions/download-artifact@v3
139+
with:
140+
name: linux-x64
141+
path: release
142+
- uses: actions/download-artifact@v3
143+
with:
144+
name: linux-all
145+
path: release
146+
- uses: actions/download-artifact@v3
147+
with:
148+
name: macOS-x64
149+
path: release
150+
- uses: actions/download-artifact@v3
151+
with:
152+
name: macOS-arm64
153+
path: release
154+
- uses: actions/download-artifact@v3
155+
with:
156+
name: debian-all
157+
path: release
158+
- uses: actions/download-artifact@v3
159+
with:
160+
name: windows-x64
161+
path: release
162+
- uses: actions/download-artifact@v3
163+
with:
164+
name: windows-x86
165+
path: release
166+
167+
- name: Checkout Preview branch
168+
uses: actions/checkout@v3
169+
with:
170+
repository: "Suwayomi/Tachidesk-Server-preview"
171+
ref: main
172+
path: preview
173+
token: ${{ secrets.DEPLOY_PREVIEW_TOKEN }}
174+
62175
- name: Generate Tag Name
63176
id: GenTagName
64177
run: |
65-
cd master/server/build
178+
cd release
66179
genTag=$(ls *.jar | sed -e's/Tachidesk-Server-\|.jar//g')
67180
echo "$genTag"
68181
echo "::set-output name=value::$genTag"
69182
70-
- name: make bundle packages
71-
run: |
72-
cd master/scripts
73-
./bundler.sh -o ../../master/server/build/ windows-x86
74-
./bundler.sh -o ../../master/server/build/ windows-x64
75-
./bundler.sh -o ../../master/server/build/ linux-all
76-
./bundler.sh -o ../../master/server/build/ linux-x64
77-
./bundler.sh -o ../../master/server/build/ debian-all
78-
./bundler.sh -o ../../master/server/build/ macOS-x64
79-
./bundler.sh -o ../../master/server/build/ macOS-arm64
80-
81-
- name: Checkout preview branch
82-
uses: actions/checkout@v2
83-
with:
84-
repository: 'Suwayomi/Tachidesk-Server-preview'
85-
ref: main
86-
path: preview
87-
token: ${{ secrets.DEPLOY_PREVIEW_TOKEN }}
88-
89183
- name: Create Tag
90184
run: |
91185
TAG="${{ steps.GenTagName.outputs.value }}"
92186
echo "tag: $TAG"
93187
cd preview
94188
echo "{ \"latest\": \"$TAG\" }" > index.json
95189
git add index.json
96-
git config --global user.email "github-actions[bot]@users.noreply.github.com"
190+
git config --global user.email \
191+
"github-actions[bot]@users.noreply.github.com"
97192
git config --global user.name "github-actions[bot]"
98193
git commit -m "Updated to $TAG"
99194
git push origin main
@@ -102,10 +197,10 @@ jobs:
102197
git push origin $TAG
103198
104199
- name: Upload Preview Release
105-
uses: ncipollo/release-action@v1
200+
uses: softprops/action-gh-release@v1
106201
with:
107202
token: ${{ secrets.DEPLOY_PREVIEW_TOKEN }}
108-
artifacts: "master/server/build/*.jar,master/server/build/*.msi,master/server/build/*.zip,master/server/build/*.tar.gz,master/server/build/*.deb"
109-
owner: "Suwayomi"
110-
repo: "Tachidesk-Server-preview"
111-
tag: ${{ steps.GenTagName.outputs.value }}
203+
repository: "Suwayomi/Tachidesk-Server-preview"
204+
tag_name: ${{ steps.GenTagName.outputs.value }}
205+
files: release/*
206+

.github/workflows/publish.yml

+121-25
Original file line numberDiff line numberDiff line change
@@ -10,27 +10,25 @@ jobs:
1010
check_wrapper:
1111
name: Validate Gradle Wrapper
1212
runs-on: ubuntu-latest
13-
1413
steps:
1514
- name: Clone repo
16-
uses: actions/checkout@v2
15+
uses: actions/checkout@v3
1716

1817
- name: Validate Gradle Wrapper
1918
uses: gradle/wrapper-validation-action@v1
20-
19+
2120
build:
22-
name: Build artifacts and release
21+
name: Build Jar
2322
needs: check_wrapper
2423
runs-on: ubuntu-latest
25-
2624
steps:
2725
- name: Cancel previous runs
28-
uses: styfle/cancel-workflow-action@0.9.0
26+
uses: styfle/cancel-workflow-action@0.10.0
2927
with:
3028
access_token: ${{ github.token }}
3129

3230
- name: Checkout ${{ github.ref }}
33-
uses: actions/checkout@v2
31+
uses: actions/checkout@v3
3432
with:
3533
ref: ${{ github.ref }}
3634
path: master
@@ -45,7 +43,8 @@ jobs:
4543
run: |
4644
cd master
4745
mkdir -p ~/.gradle
48-
cp .github/runner-files/ci-gradle.properties ~/.gradle/gradle.properties
46+
cp .github/runner-files/ci-gradle.properties \
47+
~/.gradle/gradle.properties
4948
5049
- name: Build and copy webUI, Build Jar
5150
uses: eskatos/gradle-command-action@v1
@@ -59,23 +58,120 @@ jobs:
5958
dependencies-cache-enabled: true
6059
configuration-cache-enabled: true
6160

62-
- name: Make bundle packages
61+
- name: Upload Jar
62+
uses: actions/upload-artifact@v3
63+
with:
64+
name: jar
65+
path: master/server/build/*.jar
66+
if-no-files-found: error
67+
68+
- name: Upload icons
69+
uses: actions/upload-artifact@v3
70+
with:
71+
name: icon
72+
path: master/server/src/main/resources/icon
73+
if-no-files-found: error
74+
75+
- name: Tar scripts dir to maintain file permissions
76+
run: tar -cvzf scripts.tar.gz -C master/ scripts/
77+
- name: Upload scripts.tar.gz
78+
uses: actions/upload-artifact@v3
79+
with:
80+
name: scripts
81+
path: scripts.tar.gz
82+
if-no-files-found: error
83+
84+
bundle:
85+
strategy:
86+
fail-fast: false
87+
matrix:
88+
os: [
89+
linux-x64,
90+
linux-all,
91+
macOS-x64,
92+
macOS-arm64,
93+
debian-all,
94+
windows-x64,
95+
windows-x86,
96+
]
97+
name: Make ${{ matrix.os }} release
98+
needs: build
99+
runs-on: ubuntu-latest
100+
steps:
101+
- name: Download Jar
102+
uses: actions/download-artifact@v3
103+
with:
104+
name: jar
105+
path: server/build
106+
107+
- name: Download icons
108+
uses: actions/download-artifact@v3
109+
with:
110+
name: icon
111+
path: server/src/main/resources/icon
112+
113+
- name: Download scripts.tar.gz
114+
uses: actions/download-artifact@v3
115+
with:
116+
name: scripts
117+
118+
- name: Make ${{ matrix.os }} release
63119
run: |
64-
cd master/scripts
65-
./bundler.sh -o ../../master/server/build/ windows-x86
66-
./bundler.sh -o ../../master/server/build/ windows-x64
67-
./bundler.sh -o ../../master/server/build/ linux-all
68-
./bundler.sh -o ../../master/server/build/ linux-x64
69-
./bundler.sh -o ../../master/server/build/ debian-all
70-
./bundler.sh -o ../../master/server/build/ macOS-x64
71-
./bundler.sh -o ../../master/server/build/ macOS-arm64
72-
73-
- name: Upload Release
74-
uses: xresloader/upload-to-github-release@v1
75-
env:
76-
GITHUB_TOKEN: ${{ secrets.WINGET_PUBLISH_PAT }}
120+
mkdir upload/
121+
tar -xvpf scripts.tar.gz
122+
scripts/bundler.sh -o upload/ ${{ matrix.os }}
123+
124+
- name: Upload ${{ matrix.os }} files
125+
uses: actions/upload-artifact@v3
126+
with:
127+
name: ${{ matrix.os }}
128+
path: upload/*
129+
if-no-files-found: error
130+
131+
release:
132+
if: startsWith(github.ref, 'refs/tags/v')
133+
needs: bundle
134+
runs-on: ubuntu-latest
135+
steps:
136+
- uses: actions/download-artifact@v3
137+
with:
138+
name: jar
139+
path: release
140+
- uses: actions/download-artifact@v3
141+
with:
142+
name: linux-x64
143+
path: release
144+
- uses: actions/download-artifact@v3
145+
with:
146+
name: linux-all
147+
path: release
148+
- uses: actions/download-artifact@v3
149+
with:
150+
name: macOS-x64
151+
path: release
152+
- uses: actions/download-artifact@v3
153+
with:
154+
name: macOS-arm64
155+
path: release
156+
- uses: actions/download-artifact@v3
157+
with:
158+
name: debian-all
159+
path: release
160+
- uses: actions/download-artifact@v3
161+
with:
162+
name: windows-x64
163+
path: release
164+
- uses: actions/download-artifact@v3
165+
with:
166+
name: windows-x86
167+
path: release
168+
169+
- name: Generate checksums
170+
run: cd release && sha256sum * > Checksums.sha256
171+
172+
- name: Release
173+
uses: softprops/action-gh-release@v1
77174
with:
78-
file: "master/server/build/*.jar;master/server/build/*.msi;master/server/build/*.zip;master/server/build/*.tar.gz;master/server/build/*.deb"
79-
tags: true
175+
token: ${{ secrets.WINGET_PUBLISH_PAT }}
80176
draft: true
81-
verbose: true
177+
files: release/*

0 commit comments

Comments
 (0)