Repository navigation
117 lines (109 loc) · 3.68 KB
/
Copy pathci.yml
File metadata and controls
117 lines (109 loc) · 3.68 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
name: CI
# Pull requests, and pushes to main. A branch that also has a pull request used to run this
# twice. Tests and the release build run together: each used to wait for the other, and the
# release programs are what a later tag packages instead of compiling again.
on:
push:
branches: [main]
paths-ignore:
- "site/**"
- "docs/**"
- "**/*.md"
pull_request:
paths-ignore:
- "site/**"
- "docs/**"
- "**/*.md"
concurrency:
group: ci-${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: ${{ github.ref != 'refs/heads/main' }}
permissions:
contents: read
env:
CARGO_TERM_COLOR: always
jobs:
test:
name: test (${{ matrix.os }})
strategy:
fail-fast: false
matrix:
os: [ubuntu-22.04, macos-latest, windows-latest]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v5
- uses: ./.github/actions/setup-rust
with:
cache-key: test
- name: Test
run: cargo test --workspace
# The window's own tests (prefs, search, shortcuts against the menus, the controls) build
# only with the gui feature.
- name: Test the window
if: runner.os == 'macOS'
run: cargo test -p tinyclient --features gui
package:
name: package (${{ matrix.artifact }})
strategy:
fail-fast: false
matrix:
include:
# Ubuntu 22.04 is the oldest glibc the release packages promise. Building here is
# what lets a tag reuse these binaries.
- os: ubuntu-22.04
artifact: linux-x86_64
- os: macos-latest
artifact: macos
- os: windows-latest
artifact: windows
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v5
- uses: ./.github/actions/setup-rust
with:
cache-key: release
- name: Build release
shell: bash
env:
TINYCLIENT_TELEGRAM_API_ID: ${{ secrets.TINYCLIENT_TELEGRAM_API_ID }}
TINYCLIENT_TELEGRAM_API_HASH: ${{ secrets.TINYCLIENT_TELEGRAM_API_HASH }}
run: |
cargo build --release \
-p tinyclient --features tinyclient/gui \
-p chatd -p mediad -p login
- name: Bundle tinyclient.app
if: matrix.artifact == 'macos'
run: packaging/bundle.sh --no-build
- uses: actions/upload-artifact@v6
if: matrix.artifact == 'macos'
with:
name: tinyclient-macos
path: target/release/tinyclient.app
# The release's packaging, so a change that breaks it shows here rather than at the next tag.
- name: Package .deb, .rpm, AppImage and .tar.gz
if: matrix.artifact == 'linux-x86_64'
run: |
eval "$(packaging/linux/tools.sh)"
packaging/linux.sh --no-build ci
desktop-file-validate packaging/linux/dev.tinyclient.app.desktop
dpkg-deb --info dist/tinyclient-ci-linux-x86_64.deb
dpkg-deb --contents dist/tinyclient-ci-linux-x86_64.deb
- uses: actions/upload-artifact@v6
if: matrix.artifact == 'linux-x86_64'
with:
name: tinyclient-linux-x86_64
path: dist/*
- name: Pack binaries
if: matrix.artifact == 'windows'
shell: pwsh
run: |
Compress-Archive -Path `
target/release/tinyclient.exe, `
target/release/chatd.exe, `
target/release/mediad.exe, `
target/release/tinyclient-login.exe `
-DestinationPath tinyclient-windows-x86_64.zip
- uses: actions/upload-artifact@v6
if: matrix.artifact == 'windows'
with:
name: tinyclient-windows-x86_64
path: tinyclient-windows-x86_64.zip