generated from ensaremirerol/nextjs-fastapi-starter
-
Notifications
You must be signed in to change notification settings - Fork 0
133 lines (112 loc) · 3.72 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
name: Build and Release Application
on:
push:
tags:
- '[0-9]+.[0-9]+.[0-9]+'
permissions:
contents: write
jobs:
build-mac:
runs-on: macos-latest
steps:
- uses: actions/checkout@v4
- name: Install uv
uses: astral-sh/setup-uv@v4
- name: Install node
uses: actions/setup-node@v2
with:
node-version: '22.9.0'
- name: Build
run: |
mkdir -p bin
echo "Downloading RMLMapper"
curl -L https://github.com/RMLio/rmlmapper-java/releases/download/v7.2.0/rmlmapper-7.2.0-r374-all.jar -o bin/mapper.jar
echo "Building frontend"
npm run frontend:prod
echo "Installing python dependencies"
uv sync
echo "Building application"
uv run nuitka \
--standalone \
--product-version=${{ github.ref_name }} \
--file-version=${{ github.ref_name }} \
--output-dir=dist \
--include-data-dir=public=public \
--include-data-dir=bin=bin \
--macos-create-app-bundle \
--macos-app-protected-resource="NSLocalNetworkUsageDescription:This application requires to run a local server to serve the frontend." \
--product-name=RDFCraft \
--assume-yes-for-downloads \
--deployment \
main.py
# Nuitka will produce dist/main.app. Rename to RDFCraft.app
mv dist/main.app dist/RDFCraft.app
# Zip the RDFCraft.app so it remains a folder after download
- name: Create ZIP from .app
run: |
cd dist
zip -r RDFCraft-mac.zip RDFCraft.app
- name: Upload Mac Artifact
uses: actions/upload-artifact@v4
with:
name: RDFCraft-Mac
path: dist/RDFCraft-mac.zip
build-win:
runs-on: windows-latest
steps:
- uses: actions/checkout@v4
- name: Install uv
uses: astral-sh/setup-uv@v4
- name: Install node
uses: actions/setup-node@v2
with:
node-version: '22.9.0'
- name: Build
run: |
mkdir -p bin
echo "Downloading RMLMapper"
curl -L https://github.com/RMLio/rmlmapper-java/releases/download/v7.2.0/rmlmapper-7.2.0-r374-all.jar -o bin/mapper.jar
echo "Building frontend"
npm run frontend:prod
echo "Installing python dependencies"
uv sync
echo "Building application"
.\.venv\Scripts\python.exe -m nuitka `
--standalone `
--onefile `
--product-version=$env:GITHUB_REF_NAME `
--file-version=$env:GITHUB_REF_NAME `
--output-dir=dist `
--include-data-dir=public=public `
--include-data-dir=bin=bin `
--windows-disable-console `
--product-name=RDFCraft `
--assume-yes-for-downloads `
--deployment `
main.py
mv dist/main.exe dist/RDFCraft.exe
- name: Upload Windows Artifact
uses: actions/upload-artifact@v4
with:
name: RDFCraft-Windows
path: dist/RDFCraft.exe
release:
needs: [build-mac, build-win]
runs-on: ubuntu-latest
steps:
- name: Download artifacts
uses: actions/download-artifact@v4
with:
path: artifacts
- name: Create Release
uses: 'softprops/action-gh-release@v1'
with:
tag_name: ${{ github.ref_name }}
name: ${{ github.ref_name }}
draft: false
prerelease: false
files: |
artifacts/RDFCraft-Mac/RDFCraft-mac.zip
artifacts/RDFCraft-Windows/RDFCraft.exe
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}