-
-
Notifications
You must be signed in to change notification settings - Fork 82
153 lines (121 loc) · 3.75 KB
/
Copy pathrelease.yml
File metadata and controls
153 lines (121 loc) · 3.75 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
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
# Release workflow - builds and publishes when a version tag is pushed
# Usage: git tag v0.1.0 && git push --tags
name: Release
on:
push:
tags:
- 'v*'
env:
CARGO_TERM_COLOR: always
jobs:
build-windows:
name: Build Windows
runs-on: windows-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install Rust
uses: dtolnay/rust-toolchain@stable
- name: Build release
run: cargo build --release
- name: Create release archive
run: |
mkdir release
copy target\release\ferrite.exe release\
Compress-Archive -Path release\* -DestinationPath ferrite-windows-x64.zip
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: ferrite-windows-x64
path: ferrite-windows-x64.zip
build-linux:
name: Build Linux
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install dependencies
run: |
sudo apt-get update
sudo apt-get install -y libgtk-3-dev libxcb-shape0-dev libxcb-xfixes0-dev
- name: Install Rust
uses: dtolnay/rust-toolchain@stable
- name: Install cargo-deb
run: cargo install cargo-deb
- name: Build release
run: cargo build --release
- name: Create release archive
run: |
mkdir release
cp target/release/ferrite release/
tar -czvf ferrite-linux-x64.tar.gz -C release .
- name: Build .deb package
run: cargo deb --no-build
- name: Copy .deb to workspace root
run: cp target/debian/*.deb ./ferrite-editor_amd64.deb
- name: Upload tar.gz artifact
uses: actions/upload-artifact@v4
with:
name: ferrite-linux-x64
path: ferrite-linux-x64.tar.gz
- name: Upload .deb artifact
uses: actions/upload-artifact@v4
with:
name: ferrite-linux-deb
path: ferrite-editor_amd64.deb
build-macos:
name: Build macOS
runs-on: macos-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install Rust
uses: dtolnay/rust-toolchain@stable
- name: Build release
run: cargo build --release
- name: Create release archive
run: |
mkdir release
cp target/release/ferrite release/
tar -czvf ferrite-macos-x64.tar.gz -C release .
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: ferrite-macos-x64
path: ferrite-macos-x64.tar.gz
# Create GitHub Release with all artifacts
release:
name: Create Release
needs: [build-windows, build-linux, build-macos]
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Download Windows artifact
uses: actions/download-artifact@v4
with:
name: ferrite-windows-x64
- name: Download Linux artifact
uses: actions/download-artifact@v4
with:
name: ferrite-linux-x64
- name: Download Linux .deb artifact
uses: actions/download-artifact@v4
with:
name: ferrite-linux-deb
- name: Download macOS artifact
uses: actions/download-artifact@v4
with:
name: ferrite-macos-x64
- name: Create Release
uses: softprops/action-gh-release@v1
with:
name: Ferrite ${{ github.ref_name }}
draft: false
prerelease: ${{ contains(github.ref_name, '-') }}
generate_release_notes: true
files: |
ferrite-windows-x64.zip
ferrite-linux-x64.tar.gz
ferrite-editor_amd64.deb
ferrite-macos-x64.tar.gz