forked from pipelight/pipelight
-
Notifications
You must be signed in to change notification settings - Fork 0
175 lines (157 loc) · 5.43 KB
/
release-artifacts.yml
File metadata and controls
175 lines (157 loc) · 5.43 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
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
name: Build and publish release packages
permissions:
contents: write
on:
release:
# 'published' is triggered when publishing draft release, 'created' is not
types: [published]
jobs:
build-linux-binaries:
strategy:
matrix:
include:
- target: x86_64-unknown-linux-gnu
os: ubuntu-latest
- target: x86_64-unknown-linux-musl
os: ubuntu-latest
- target: aarch64-unknown-linux-musl
os: ubuntu-latest
runs-on: ${{ matrix.os }}
steps:
- name: Install dependencies
run: |
sudo apt-get update
sudo apt-get install -y gcc-multilib clang cmake pkg-config libssl-dev
rustup default stable
rustup update
rustup show
cargo -Vv
- uses: actions/checkout@v4
- name: Install Protoc
uses: arduino/setup-protoc@v3
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@stable
- name: Install cross-compilation tools
with:
target: ${{ matrix.target }}
if: startsWith(matrix.os, 'ubuntu') && contains(matrix.target, '-musl')
uses: taiki-e/setup-cross-toolchain-action@v1
- name: Build and publish
uses: taiki-e/upload-rust-binary-action@v1
with:
bin: pipelight
target: ${{ matrix.target }}
token: ${{ secrets.GITHUB_TOKEN }}
- name: Build Debian Package
if: matrix.target == 'x86_64-unknown-linux-musl'
run: |
cargo install cargo-deb
cargo deb --no-strip --target ${{ matrix.target }}
- name: Upload Debian package
if: matrix.target == 'x86_64-unknown-linux-musl'
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: target/${{ matrix.target }}/debian/*.deb
tag: ${{ github.ref }}
overwrite: true
file_glob: true
# build-mac-binaries:
# strategy:
# matrix:
# include:
# - target: x86_64-apple-darwin
# os: macos-latest
# - target: aarch64-apple-darwin
# os: macos-latest
# runs-on: ${{ matrix.os }}
# steps:
# - name: Install dependencies
# run: |
# brew update-reset
# brew install gcc cmake protobuf-c
# rustup default stable
# rustup update
# rustup show
# cargo -Vv
# - uses: actions/checkout@v4
# - name: Build and publish
# uses: taiki-e/upload-rust-binary-action@v1
# with:
# bin: pipelight
# target: ${{ matrix.target }}
# token: ${{ secrets.GITHUB_TOKEN }}
# build-windows-binaries:
# strategy:
# matrix:
# include:
# - os: windows-latest
# runs-on: ${{ matrix.os }}
# steps:
# - name: Install minimal stable
# uses: dtolnay/rust-toolchain@stable
# - uses: actions/checkout@v4
# - uses: Swatinem/rust-cache@v2
# - name: Install Protoc
# uses: arduino/setup-protoc@v3
# with:
# repo-token: ${{ secrets.GITHUB_TOKEN }}
# - name: Build
# run: cargo build --release --locked
# - name: Build and publish
# uses: taiki-e/upload-rust-binary-action@v1
# with:
# bin: pipelight
# token: ${{ secrets.GITHUB_TOKEN }}
# build-app-image:
# strategy:
# matrix:
# include:
# - os: ubuntu-20.04
# runs-on: ${{ matrix.os }}
# steps:
# - uses: actions/checkout@v4
# - name: Install dependencies
# run: |
# sudo apt-get update
# sudo apt-get install -y gcc-multilib clang cmake protobuf-compiler libfuse2
# - name: Install Protoc
# uses: arduino/setup-protoc@v3
# with:
# repo-token: ${{ secrets.GITHUB_TOKEN }}
# - name: Install Rust toolchain
# uses: dtolnay/rust-toolchain@stable
# - name: Build release binary
# run: cargo build --release
# - name: Build AppImage
# shell: bash
# run: |
# mkdir -p AppDir
# cp target/release/pipelight .
# curl -Lo linuxdeploy-x86_64.AppImage \
# https://github.com/linuxdeploy/linuxdeploy/releases/download/continuous/linuxdeploy-x86_64.AppImage
# chmod +x linuxdeploy-x86_64.AppImage
# ./linuxdeploy-x86_64.AppImage \
# --appdir AppDir \
# --executable pipelight \
# -d pkg/appimage/pipelight.desktop \
# -i pipelight.svg \
# --custom-apprun pkg/appimage/AppRun.sh
# wget -O dist-pipelight.zip "$(curl --silent "https://api.github.com/repos/pipelight/pipelight-web-ui/releases/latest" | jq -r '.assets[] | select(.name=="dist-pipelight.zip") | .browser_download_url')"
# unzip -o dist-pipelight.zip -d static
# mv -n static/dist/* static/
# rm -rf static/dist
# mv static AppDir/usr/share
# ./linuxdeploy-x86_64.AppImage \
# --appdir AppDir \
# --output appimage
# - name: Upload AppImage
# uses: svenstaro/upload-release-action@v2
# with:
# repo_token: ${{ secrets.GITHUB_TOKEN }}
# file: "pipelight-x86_64.AppImage"
# tag: ${{ github.ref }}
# overwrite: true
# file_glob: true