-
Notifications
You must be signed in to change notification settings - Fork 40
118 lines (103 loc) · 3.35 KB
/
Copy pathdev-release.yml
File metadata and controls
118 lines (103 loc) · 3.35 KB
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
name: Dev Release
on:
push:
branches:
- main
paths:
- 'packages/**/*.ts'
- 'packages/**/*.tsx'
- 'packages/**/*.lock'
- 'packages/**/*.json'
- '*.yaml'
- '*.yml'
# Schema changes are handled by generate-migrations.yml, which triggers
# this workflow via workflow_dispatch after migrations are committed.
- '!packages/backend/drizzle/schema/**'
workflow_dispatch:
inputs:
sha:
description: 'Commit SHA to build (used when triggered after migration generation)'
required: false
type: string
jobs:
dev-release:
name: Dev Release
runs-on: ubuntu-latest
if: github.ref == 'refs/heads/main' || github.event_name == 'workflow_dispatch'
permissions:
contents: write
packages: write
steps:
- name: Determine commit SHA
id: sha
run: |
if [ -n "${{ inputs.sha }}" ]; then
echo "sha=${{ inputs.sha }}" >> "$GITHUB_OUTPUT"
else
echo "sha=${{ github.sha }}" >> "$GITHUB_OUTPUT"
fi
- name: Checkout repository
uses: actions/checkout@v7
with:
ref: ${{ steps.sha.outputs.sha }}
- name: Set up Bun
uses: oven-sh/setup-bun@v2
with:
bun-version: latest
- name: Install Base dependencies
run: bun install --frozen-lockfile
working-directory: .
- name: Install Backend dependencies
run: bun install --frozen-lockfile
working-directory: ./packages/backend
- name: Install Frontend dependencies
run: bun install --frozen-lockfile
working-directory: ./packages/frontend
- name: Build frontend
env:
APP_VERSION: dev-${{ steps.sha.outputs.sha }}
run: bun run build:frontend
- name: Compile Binaries
# compiling each platform separately
# Frontend is built above; compile:* scripts skip the rebuild in CI via build:frontend:if-needed.
run: |
bun run compile:linux-amd64
bun run compile:linux-arm64
bun run compile:macos
bun run compile:windows
- name: Log in to the Container registry
uses: docker/login-action@v4
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@v6
with:
images: ghcr.io/${{ github.repository }}
tags: |
type=raw,value=dev
- name: Build and push Docker image
uses: docker/build-push-action@v7
with:
context: .
push: true
tags: ghcr.io/${{ github.repository }}:dev
labels: ${{ steps.meta.outputs.labels }}
build-args: |
APP_VERSION=dev-${{ steps.sha.outputs.sha }}
- name: Create dev pre-release
uses: softprops/action-gh-release@v3
with:
files: |
plexus-linux-amd64
plexus-linux-arm64
plexus-macos
plexus.exe
draft: false
prerelease: true
tag_name: dev-${{ steps.sha.outputs.sha }}
body: |
Development pre-release from commit ${{ steps.sha.outputs.sha }}
Built from: `main` at `${{ steps.sha.outputs.sha }}`