Skip to content

Commit 42aa1e8

Browse files
committed
feat: add CI/CD pipelines with semantic-release and multi-platform Electron builds
- Add GitHub Actions workflows for CI (lint + test), semantic-release, multi-platform desktop builds (macOS, Windows, Linux), and Docker image publishing to Docker Hub - Configure electron-builder for x64/arm64 on macOS and x64/ia32 on Windows - Wire desktop and Docker workflows as downstream jobs triggered after a successful semantic-release
1 parent ec48016 commit 42aa1e8

8 files changed

Lines changed: 2136 additions & 10 deletions

File tree

.github/workflows/ci.yml

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
name: CI
2+
3+
on:
4+
pull_request:
5+
branches: [main]
6+
workflow_call:
7+
8+
jobs:
9+
lint:
10+
runs-on: ubuntu-latest
11+
steps:
12+
- uses: actions/checkout@v4
13+
- uses: pnpm/action-setup@v4
14+
- uses: actions/setup-node@v4
15+
with:
16+
node-version: 20
17+
cache: pnpm
18+
- run: pnpm install --frozen-lockfile
19+
- run: pnpm check
20+
21+
test:
22+
runs-on: ubuntu-latest
23+
steps:
24+
- uses: actions/checkout@v4
25+
- uses: pnpm/action-setup@v4
26+
- uses: actions/setup-node@v4
27+
with:
28+
node-version: 20
29+
cache: pnpm
30+
- run: pnpm install --frozen-lockfile
31+
- run: pnpm test

.github/workflows/desktop.yml

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
name: Desktop
2+
3+
on:
4+
workflow_call:
5+
inputs:
6+
tag:
7+
required: true
8+
type: string
9+
10+
jobs:
11+
build:
12+
strategy:
13+
matrix:
14+
include:
15+
- os: macos-latest
16+
platform: mac
17+
- os: ubuntu-latest
18+
platform: linux
19+
- os: windows-latest
20+
platform: win
21+
runs-on: ${{ matrix.os }}
22+
permissions:
23+
contents: write
24+
steps:
25+
- uses: actions/checkout@v4
26+
with:
27+
ref: ${{ inputs.tag }}
28+
29+
- uses: pnpm/action-setup@v4
30+
31+
- uses: actions/setup-node@v4
32+
with:
33+
node-version: 20
34+
cache: pnpm
35+
36+
- run: pnpm install --frozen-lockfile
37+
38+
- run: pnpm build:desktop
39+
40+
- uses: actions/upload-artifact@v4
41+
with:
42+
name: desktop-${{ matrix.platform }}
43+
path: |
44+
packages/desktop/out/*.dmg
45+
packages/desktop/out/*.exe
46+
packages/desktop/out/*.AppImage
47+
if-no-files-found: ignore
48+
49+
- uses: softprops/action-gh-release@v2
50+
with:
51+
tag_name: ${{ inputs.tag }}
52+
files: |
53+
packages/desktop/out/*.dmg
54+
packages/desktop/out/*.exe
55+
packages/desktop/out/*.AppImage

.github/workflows/docker.yml

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
name: Docker
2+
3+
on:
4+
workflow_call:
5+
inputs:
6+
tag:
7+
required: true
8+
type: string
9+
10+
env:
11+
IMAGE_NAME: ${{ github.repository }}
12+
13+
jobs:
14+
build-and-push:
15+
runs-on: ubuntu-latest
16+
permissions:
17+
contents: read
18+
packages: write
19+
steps:
20+
- uses: actions/checkout@v4
21+
with:
22+
ref: ${{ inputs.tag }}
23+
24+
- uses: docker/setup-qemu-action@v3
25+
26+
- uses: docker/setup-buildx-action@v3
27+
28+
- uses: docker/login-action@v3
29+
with:
30+
username: ${{ secrets.DOCKERHUB_USERNAME }}
31+
password: ${{ secrets.DOCKERHUB_TOKEN }}
32+
33+
- uses: docker/metadata-action@v5
34+
id: meta
35+
with:
36+
images: ${{ env.IMAGE_NAME }}
37+
tags: |
38+
type=semver,pattern={{version}},value=${{ inputs.tag }}
39+
type=semver,pattern={{major}}.{{minor}},value=${{ inputs.tag }}
40+
type=sha
41+
42+
- uses: docker/build-push-action@v6
43+
with:
44+
context: .
45+
platforms: linux/amd64,linux/arm64
46+
push: true
47+
tags: ${{ steps.meta.outputs.tags }}
48+
labels: ${{ steps.meta.outputs.labels }}
49+
cache-from: type=gha
50+
cache-to: type=gha,mode=max

.github/workflows/release.yml

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
name: Release
2+
3+
on:
4+
push:
5+
branches: [main]
6+
7+
jobs:
8+
ci:
9+
uses: ./.github/workflows/ci.yml
10+
11+
release:
12+
needs: ci
13+
runs-on: ubuntu-latest
14+
permissions:
15+
contents: write
16+
issues: write
17+
pull-requests: write
18+
outputs:
19+
new-release-published: ${{ steps.semantic.outputs.new_release_published }}
20+
new-release-version: ${{ steps.semantic.outputs.new_release_version }}
21+
steps:
22+
- uses: actions/checkout@v4
23+
with:
24+
fetch-depth: 0
25+
persist-credentials: false
26+
27+
- uses: pnpm/action-setup@v4
28+
29+
- uses: actions/setup-node@v4
30+
with:
31+
node-version: 20
32+
cache: pnpm
33+
34+
- run: pnpm install --frozen-lockfile
35+
36+
- name: Semantic Release
37+
id: semantic
38+
uses: cycjimmy/semantic-release-action@v4
39+
env:
40+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
41+
42+
desktop:
43+
needs: release
44+
if: needs.release.outputs.new-release-published == 'true'
45+
uses: ./.github/workflows/desktop.yml
46+
with:
47+
tag: v${{ needs.release.outputs.new-release-version }}
48+
permissions:
49+
contents: write
50+
51+
docker:
52+
needs: release
53+
if: needs.release.outputs.new-release-published == 'true'
54+
uses: ./.github/workflows/docker.yml
55+
with:
56+
tag: v${{ needs.release.outputs.new-release-version }}
57+
permissions:
58+
contents: read
59+
packages: write

.releaserc.json

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
{
2+
"branches": ["main"],
3+
"plugins": [
4+
"@semantic-release/commit-analyzer",
5+
"@semantic-release/release-notes-generator",
6+
"@semantic-release/changelog",
7+
[
8+
"@semantic-release/npm",
9+
{
10+
"npmPublish": false
11+
}
12+
],
13+
[
14+
"@semantic-release/git",
15+
{
16+
"assets": ["package.json", "CHANGELOG.md"],
17+
"message": "chore(release): ${nextRelease.version} [skip ci]\n\n${nextRelease.notes}"
18+
}
19+
],
20+
"@semantic-release/github"
21+
]
22+
}

package.json

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
{
22
"name": "@fgiova/localstack-explorer",
33
"private": true,
4+
"version": "0.0.0",
45
"type": "module",
56
"scripts": {
67
"dev": "pnpm -r --parallel run dev",
@@ -19,14 +20,17 @@
1920
},
2021
"packageManager": "pnpm@9.15.4",
2122
"engines": {
22-
"node": ">=20"
23+
"node": ">=24"
2324
},
2425
"workspaces": [
2526
"packages/backend",
2627
"packages/frontend",
2728
"packages/desktop"
2829
],
2930
"devDependencies": {
30-
"@biomejs/biome": "^2.4.9"
31+
"@biomejs/biome": "^2.4.9",
32+
"@semantic-release/changelog": "^6.0.3",
33+
"@semantic-release/git": "^10.0.1",
34+
"semantic-release": "^25.0.3"
3135
}
3236
}

packages/desktop/electron-builder.json

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,25 @@
99
],
1010
"mac": {
1111
"category": "public.app-category.developer-tools",
12-
"icon": "icon.png"
12+
"icon": "icon.png",
13+
"target": [
14+
{
15+
"target": "dmg",
16+
"arch": ["x64", "arm64"]
17+
}
18+
]
1319
},
1420
"linux": {
1521
"target": ["AppImage"],
1622
"category": "Development"
1723
},
1824
"win": {
19-
"target": ["nsis"],
25+
"target": [
26+
{
27+
"target": "nsis",
28+
"arch": ["x64", "ia32"]
29+
}
30+
],
2031
"icon": "icon.png"
2132
},
2233
"directories": {

0 commit comments

Comments
 (0)