-
Notifications
You must be signed in to change notification settings - Fork 3
169 lines (150 loc) · 5.46 KB
/
release.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
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
name: "Manual Tauri Release"
on:
workflow_dispatch:
inputs:
# tag_name:
# description: "Tag name for the release"
# required: true
release_name:
description: "Release title"
required: true
release_type:
description: "Type of release (draft, private, public)"
required: true
default: "draft"
release_notes:
description: "Release notes"
required: false
jobs:
create_release:
name: Create GitHub Release
runs-on: ubuntu-latest
outputs:
release_upload_url: ${{ steps.create_release.outputs.upload_url }}
steps:
- name: Create a release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.ref_name }}
release_name: ${{ github.event.inputs.release_name }}
body: ${{ github.event.inputs.release_notes }}
draft: ${{ github.event.inputs.release_type == 'draft' }} # not visible to the public
prerelease: ${{ github.event.inputs.release_type == 'private' }} # visible only to collaborators
build:
name: Build and Upload Artifacts
needs: create_release
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, macos-latest, windows-latest] # builds for each platform, in seperate vm's, in this order
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0 # Fetch all history for proper Git submodule initialization
ref: ${{ github.event.inputs.ref || github.ref }} # checks out code you specify in github UI
- name: Set up Node.js
uses: actions/setup-node@v3
with:
node-version: "18"
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: "3.12"
- name: Set up pip for Python
run: |
python --version
pip --version || python -m ensurepip --upgrade
python -m pip install --upgrade pip
- name: Install dependencies
run: |
corepack enable
corepack prepare pnpm@latest --activate
pnpm install-reqs
- name: Build icons
run: pnpm build:icons
- name: Build Python sidecar
run: |
if [[ "${{ runner.os }}" == "Linux" ]]; then
pnpm build:sidecar-linux
elif [[ "${{ runner.os }}" == "macOS" ]]; then
pnpm build:sidecar-macos
elif [[ "${{ runner.os }}" == "Windows" ]]; then
pnpm build:sidecar-winos
fi
- name: Build Next.js
run: pnpm run next build
- name: Set up Rust
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable # You can also specify a version, e.g., "1.72.0"
override: true
- name: Build Tauri app
run: pnpm tauri build
- name: Upload artifact
uses: actions/upload-artifact@v3
with:
name: ${{ runner.os }}-artifact
path: |
if [[ "${{ runner.os }}" == "Windows" ]]; then
echo "src-tauri/target/release/bundle/nsis/tauri-python-sidecar_0.1.0_x64_Windows-setup.zip"
else
echo "src-tauri/target/release/bundle/"
fi
upload_assets:
name: Upload Assets to Release
needs: build
runs-on: ubuntu-latest
steps:
- name: Download Linux artifact
if: always()
uses: actions/download-artifact@v3
with:
name: ubuntu-latest-artifact
path: ./artifacts/ubuntu
- name: Download macOS artifact
if: always()
uses: actions/download-artifact@v3
with:
name: macos-latest-artifact
path: ./artifacts/macos
- name: Download Windows artifact
if: always()
uses: actions/download-artifact@v3
with:
name: windows-latest-artifact
path: ./artifacts/windows
- name: Upload Linux asset
if: always()
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ needs.create_release.outputs.release_upload_url }}
asset_path: ./artifacts/ubuntu/tauri-python-sidecar_${{ github.ref }}_x86_x64_Linux-setup.AppImage
asset_name: tauri-python-sidecar_${{ github.ref }}_x86_x64_Linux-setup.AppImage
asset_content_type: application/octet-stream
- name: Upload macOS asset
if: always()
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ needs.create_release.outputs.release_upload_url }}
asset_path: ./artifacts/macos/tauri-python-sidecar_${{ github.ref }}_x86_x64_macOS-setup.dmg
asset_name: tauri-python-sidecar_${{ github.ref }}_x86_x64_macOS-setup.dmg
asset_content_type: application/octet-stream
- name: Upload Windows asset
if: always()
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ needs.create_release.outputs.release_upload_url }}
asset_path: ./artifacts/windows/tauri-python-sidecar_${{ github.ref }}_x86_x64_Windows-setup.zip
asset_name: tauri-python-sidecar_${{ github.ref }}_x86_x64_Windows-setup.zip
asset_content_type: application/octet-stream