-
-
Notifications
You must be signed in to change notification settings - Fork 68
135 lines (108 loc) · 3.23 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
134
135
name: Build & create release
on:
workflow_dispatch:
inputs:
jobs:
#########
# BUILD #
#########
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
# Tasks
- run: npm install
- run: npx just build-prod
# Upload artifacts
- uses: actions/upload-artifact@v4
with:
name: dist
path: dist/
##################
# CREATE RELEASE #
##################
create-release:
needs: build
runs-on: ubuntu-latest
outputs:
RELEASE_UPLOAD_ID: ${{ steps.create_release.outputs.id }}
TAG_NAME: ${{ steps.package-version.outputs.current-version }}
steps:
- uses: actions/checkout@v4
- run: mkdir compressed
# Download artifacts
- uses: actions/download-artifact@v4
with:
name: dist
path: dist/
# Create zip
- uses: montudor/action-zip@v1
with:
args: zip -qq -r ./compressed/diffuse-web.zip ./dist
# Create tar.gz
- uses: master-atul/[email protected]
with:
command: c
cwd: .
files: ./dist
outPath: compressed/diffuse-web.tar.gz
# Get Diffuse's version number
- id: package-version
uses: martinbeentjes/[email protected]
# Create release
- uses: softprops/action-gh-release@v1
id: create_release
with:
token: ${{ secrets.GITHUB_TOKEN }}
tag_name: "${{ steps.package-version.outputs.current-version }}"
name: "v${{ steps.package-version.outputs.current-version }}"
body: "See the assets to download this version and install."
draft: true
files: |
compressed/diffuse-web.zip
compressed/diffuse-web.tar.gz
#########
# TAURI #
#########
tauri:
needs: create-release
strategy:
fail-fast: false
matrix:
os: [macos-14, macos-13, ubuntu-latest, windows-latest]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
# Install dependencies
- run: npm install
# OS
- name: install linux dependencies
if: matrix.os == 'ubuntu-latest'
run: |
sudo apt-get update
sudo apt-get install -y libwebkit2gtk-4.0-dev libappindicator3-dev librsvg2-dev libsoup-3.0
# Rust
- uses: moonrepo/setup-rust@v1
# Download artifacts
- uses: actions/download-artifact@v4
with:
name: dist
path: dist/
# Make a build
- run: npx tauri build
# Upload artifacts
- uses: softprops/action-gh-release@v1
with:
token: ${{ secrets.GITHUB_TOKEN }}
tag_name: "${{ needs.create-release.outputs.TAG_NAME }}"
draft: true
files: |
src-tauri/target/release/bundle/appimage/*.AppImage
src-tauri/target/release/bundle/deb/*.deb
src-tauri/target/release/bundle/dmg/*.dmg
src-tauri/target/release/bundle/macos/*.app
src-tauri/target/release/bundle/msi/*.msi
src-tauri/target/release/bundle/nsis/*.exe
src-tauri/target/release/bundle/rpm/*.rpm