Skip to content

Commit c611e38

Browse files
committed
feat(ci): update release workflows
1 parent b0508a2 commit c611e38

File tree

10 files changed

+103
-110
lines changed

10 files changed

+103
-110
lines changed

.github/workflows/release.yaml

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -18,18 +18,17 @@ jobs:
1818
run: |
1919
VERSION=${GITHUB_REF_NAME#v}
2020
echo "VERSION=$VERSION" >> $GITHUB_ENV
21+
echo "PLATFORM=linux" >> $GITHUB_ENV
2122
- name: Set up Node
2223
uses: actions/setup-node@v4
2324
with:
2425
node-version: 20
2526
- name: Install node dependencies
2627
run: npm ci
2728
- name: Build Linux
28-
run: make linux
29-
- name: Archive
30-
run: make archives PLATFORM=linux VERSION=$VERSION
29+
run: ./scripts/build.sh
3130
- name: Linux Release
32-
run: make linux-release
31+
run: ./scripts/release.sh
3332
env:
3433
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
3534
build-windows:
@@ -45,6 +44,7 @@ jobs:
4544
run: |
4645
VERSION=${GITHUB_REF_NAME#v}
4746
echo "VERSION=$VERSION" >> $GITHUB_ENV
47+
echo "PLATFORM=windows" >> $GITHUB_ENV
4848
- name: Set up Node
4949
uses: actions/setup-node@v4
5050
with:
@@ -53,10 +53,10 @@ jobs:
5353
run: npm ci
5454
- name: Build Windows
5555
shell: bash
56-
run: make windows
56+
run: ./scripts/build.sh
5757
- name: Windows Release
5858
shell: bash
59-
run: make windows-release
59+
run: ./scripts/release.sh
6060
env:
6161
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
6262
build-macos:
@@ -67,22 +67,22 @@ jobs:
6767
uses: actions/checkout@v4
6868
with:
6969
fetch-depth: 0
70-
# https://github.com/electron/forge/issues/2807
71-
- name: Install python3-setuptools and bash
72-
run: brew install python-setuptools bash
70+
- name: Install bash
71+
run: brew install bash
7372
- name: Set up env
7473
run: |
7574
VERSION=${GITHUB_REF_NAME#v}
7675
echo "VERSION=$VERSION" >> $GITHUB_ENV
76+
echo "PLATFORM=macos" >> $GITHUB_ENV
7777
- name: Set up Node
7878
uses: actions/setup-node@v4
7979
with:
8080
node-version: 20
8181
- name: Install node dependencies
8282
run: npm ci
8383
- name: Build MacOS
84-
run: make macos
84+
run: ./scripts/build.sh
8585
- name: MacOS Release
86-
run: make macos-release
86+
run: ./scripts/release.sh
8787
env:
8888
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

dev-app-update.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
---
12
provider: generic
2-
url: https://example.com/auto-updates
3-
updaterCacheDirName: bananas2-updater
3+
url: https://auto-updates.getbananas.net
4+
updaterCacheDirName: bananas-updater

electron-builder.yml

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
1+
---
12
appId: com.electron.app
2-
productName: bananas2
3+
productName: bananas
34
directories:
45
buildResources: build
56
files:
@@ -12,9 +13,9 @@ files:
1213
asarUnpack:
1314
- resources/**
1415
win:
15-
executableName: bananas2
16+
executableName: bananas
1617
nsis:
17-
artifactName: ${name}-${version}-setup.${ext}
18+
artifactName: ${name}-setup_${arch}.${ext}
1819
shortcutName: ${productName}
1920
uninstallDisplayName: ${productName}
2021
createDesktopShortcut: always
@@ -27,7 +28,7 @@ mac:
2728
- NSDownloadsFolderUsageDescription: Application requests access to the user's Downloads folder.
2829
notarize: false
2930
dmg:
30-
artifactName: ${name}-${version}.${ext}
31+
artifactName: ${name}_${arch}.${ext}
3132
linux:
3233
target:
3334
- AppImage
@@ -36,7 +37,11 @@ linux:
3637
maintainer: electronjs.org
3738
category: Utility
3839
appImage:
39-
artifactName: ${name}-${version}.${ext}
40+
artifactName: ${name}_${arch}.${ext}
41+
snap:
42+
artifactName: ${name}_${arch}.${ext}
43+
deb:
44+
artifactName: ${name}_${arch}.${ext}
4045
npmRebuild: false
4146
publish:
4247
provider: generic

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,8 @@
2020
"build": "npm run typecheck && electron-vite build",
2121
"postinstall": "electron-builder install-app-deps",
2222
"build:unpack": "npm run build && electron-builder --dir",
23-
"build:win": "npm run build && electron-builder --win",
24-
"build:mac": "npm run build && electron-builder --mac",
23+
"build:windows": "npm run build && electron-builder --win",
24+
"build:macos": "npm run build && electron-builder --mac",
2525
"build:linux": "npm run build && electron-builder --linux"
2626
},
2727
"dependencies": {

resources/icon.png

7.74 KB
Loading

scripts/build.sh

Lines changed: 1 addition & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -3,33 +3,12 @@
33
if [ -z "$VERSION" ]; then echo "Error: VERSION is not set"; exit 1; fi
44
if [ -z "$PLATFORM" ]; then echo "Error: PLATFORM is not set"; exit 1; fi
55

6-
BUILDOS=""
7-
86
update_package_json_version() {
97
local tmp
108
tmp=$(mktemp)
119
jq --arg v "$VERSION" '.version = $v' package.json > "$tmp" && mv "$tmp" package.json
1210
}
1311

14-
set_buildos_based_on_platform() {
15-
case $PLATFORM in
16-
linux)
17-
BUILDOS="linux"
18-
;;
19-
windows)
20-
BUILDOS="win32"
21-
;;
22-
macos)
23-
BUILDOS="darwin"
24-
;;
25-
*)
26-
echo "Error: PLATFORM $PLATFORM is not supported"
27-
exit 1
28-
;;
29-
esac
30-
}
31-
32-
set_buildos_based_on_platform
3312
update_package_json_version
3413

35-
npm run make -- --arch=x64 --platform=$BUILDOS
14+
npm run "build:$PLATFORM"

scripts/release.sh

Lines changed: 8 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -9,20 +9,19 @@ GH_TAG="v$VERSION"
99
FILES=()
1010

1111
LINUX_FILES=(
12-
"out/make/deb/x64/${BIN_NAME}_${VERSION}-amd64.deb"
13-
"out/make/rpm/x64/${BIN_NAME}-${VERSION}-x86_64.rpm"
12+
"dist/${BIN_NAME}_amd64.deb"
13+
"dist/${BIN_NAME}_amd64.snap"
14+
"dist/${BIN_NAME}_x86_64.AppImage"
1415
)
1516

1617
WINDOWS_FILES=(
17-
"out/make/squirrel.windows/x64/${BIN_NAME}-${VERSION}-setup.exe"
18-
"out/make/squirrel.windows/x64/${BIN_NAME}-${VERSION}-full.nupkg"
18+
"dist/${BIN_NAME}-setup_x64.exe"
1919
)
2020

2121
MACOS_FILES=(
22-
"out/make/$BIN_NAME-$VERSION-x64.dmg"
22+
"dist/${BIN_NAME}_x64.dmg"
2323
)
2424

25-
2625
set_release_action() {
2726
if gh release view "$GH_TAG" --json id --jq .id > /dev/null 2>&1; then
2827
echo "Release $GH_TAG already exists, updating it"
@@ -45,6 +44,8 @@ check_files_exist() {
4544
for file in "${files[@]}"; do
4645
printf " - %s\n" "$file"
4746
done
47+
echo "This is the content of the dist directory:"
48+
ls -l dist/
4849
exit 1
4950
fi
5051
}
@@ -92,23 +93,11 @@ do_gh_release() {
9293
fi
9394
}
9495

95-
create_archives() {
96-
cd out/ && tar -czvf "${BIN_NAME}_${VERSION}_linux-x64.tar.gz" "${BIN_NAME}-linux-x64"
97-
}
98-
9996
release() {
10097
set_release_action
10198
set_files_based_on_platform
10299
check_files_exist
103100
do_gh_release
104101
}
105102

106-
boot() {
107-
if [ -z "$CREATE_ARCHIVES" ]; then
108-
release
109-
else
110-
create_archives
111-
fi
112-
}
113-
114-
boot
103+
release

src/renderer/src/App.svelte

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<script lang="ts">
2-
const ipcHandle = (): void => window.electron.ipcRenderer.send('ping')
2+
// const ipcHandle = (): void => window.electron.ipcRenderer.send('ping')
33
import Navigation from './Navigation.svelte'
44
import { webRTC } from './WebRTC'
55
@@ -17,6 +17,7 @@
1717

1818
<div class="container">
1919
<Navigation />
20+
<h1 class="title">Join</h1>
2021
<button class="button" id="startButton" on:click={startFunc}>Start</button>
2122
<h2>Local</h2>
2223
<div>

src/renderer/src/Navigation.svelte

Lines changed: 50 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,28 @@
11
<script lang="ts">
2-
const handleTopButtonsClick = (evt: MouseEvent) => {
2+
const externalLinkClickHandler = (root: HTMLButtonElement, url: string): void => {
3+
root.classList.add('is-loading')
4+
root.classList.add('is-primary')
5+
setTimeout(() => {
6+
root.classList.remove('is-loading')
7+
root.classList.remove('is-primary')
8+
}, 3000)
9+
window.open(url)
10+
}
11+
12+
const handleTopButtonsClick = (evt: MouseEvent): void => {
313
evt.preventDefault()
414
const target = evt.target as HTMLButtonElement
515
const root = target.closest('button')
616
switch (root.dataset.action) {
7-
case 'reportABug':
8-
root.classList.add('is-loading')
9-
setTimeout(() => {
10-
root.classList.remove('is-loading')
11-
}, 3000)
12-
window.open('https://github.com/mistweaverco/bananas/issues/new')
17+
case 'join':
18+
break
19+
case 'host':
1320
break
14-
case 'seeTheCode':
15-
root.classList.add('is-loading')
16-
setTimeout(() => {
17-
root.classList.remove('is-loading')
18-
}, 3000)
19-
window.open('https://github.com/mistweaverco/bananas')
21+
case 'report-a-bug':
22+
externalLinkClickHandler(root, 'https://github.com/mistweaverco/bananas/issues/new')
23+
break
24+
case 'see-the-code':
25+
externalLinkClickHandler(root, 'https://github.com/mistweaverco/bananas')
2026
break
2127
default:
2228
break
@@ -28,7 +34,34 @@
2834
<div class="navbar-menu p-2">
2935
<div class="navbar-start">
3036
<div class="navbar-item">
31-
<div class="buttons"></div>
37+
<div class="buttons">
38+
<button
39+
class="button is-primary is-active"
40+
data-action="join"
41+
on:click={handleTopButtonsClick}
42+
>
43+
<span class="icon">
44+
<i class="fa-solid fa-right-to-bracket"></i>
45+
</span>
46+
<strong>Join a session</strong>
47+
</button>
48+
<button class="button is-secondary" data-action="host" on:click={handleTopButtonsClick}>
49+
<span class="icon">
50+
<i class="fa-solid fa-earth-africa"></i>
51+
</span>
52+
<strong>Host a session</strong>
53+
</button>
54+
<button
55+
class="button is-secondary"
56+
data-action="settings"
57+
on:click={handleTopButtonsClick}
58+
>
59+
<span class="icon">
60+
<i class="fa-solid fa-gear"></i>
61+
</span>
62+
<strong>Settings</strong>
63+
</button>
64+
</div>
3265
</div>
3366
</div>
3467

@@ -37,7 +70,7 @@
3770
<div class="buttons">
3871
<button
3972
class="button is-secondary"
40-
data-action="reportABug"
73+
data-action="report-a-bug"
4174
on:click={handleTopButtonsClick}
4275
>
4376
<span class="icon">
@@ -46,8 +79,8 @@
4679
<strong>Report a bug</strong>
4780
</button>
4881
<button
49-
class="button is-primary"
50-
data-action="seeTheCode"
82+
class="button is-secondary"
83+
data-action="see-the-code"
5184
on:click={handleTopButtonsClick}
5285
>
5386
<span class="icon">
@@ -60,14 +93,3 @@
6093
</div>
6194
</div>
6295
</nav>
63-
<nav class="panel">
64-
<p class="panel-heading">Dashboard</p>
65-
<p class="panel-tabs">
66-
<a data-action="Overview">
67-
<span class="icon">
68-
<i class="fa-solid fa-chart-bar"></i>
69-
</span>
70-
Start new session
71-
</a>
72-
</p>
73-
</nav>

0 commit comments

Comments
 (0)