Skip to content

Commit 342cbb6

Browse files
committed
ci: add .deb and .rpm builds
1 parent 9d65ef5 commit 342cbb6

File tree

4 files changed

+130
-68
lines changed

4 files changed

+130
-68
lines changed

.github/workflows/cd.yaml

Lines changed: 125 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,125 @@
1+
name: Build and upload release
2+
3+
permissions:
4+
contents: write
5+
6+
on:
7+
release:
8+
types: [published]
9+
10+
env:
11+
CARGO_INCREMENTAL: 0
12+
CARGO_NET_GIT_FETCH_WITH_CLI: true
13+
CARGO_NET_RETRY: 10
14+
CARGO_TERM_COLOR: always
15+
CARGO_PROFILE_RELEASE_LTO: true
16+
RUST_BACKTRACE: 1
17+
RUSTFLAGS: -D warnings
18+
RUSTUP_MAX_RETRIES: 10
19+
20+
defaults:
21+
run:
22+
shell: bash
23+
24+
jobs:
25+
upload-assets:
26+
name: ${{ matrix.target }}
27+
if: github.repository_owner == 'tombhx'
28+
runs-on: ${{ matrix.os }}
29+
timeout-minutes: 60
30+
strategy:
31+
fail-fast: false
32+
matrix:
33+
include:
34+
- target: aarch64-unknown-linux-gnu
35+
os: ubuntu-22.04-arm
36+
- target: x86_64-unknown-linux-gnu
37+
os: ubuntu-22.04
38+
39+
- target: aarch64-apple-darwin
40+
os: macos-13
41+
- target: x86_64-apple-darwin
42+
os: macos-13
43+
44+
- target: aarch64-pc-windows-msvc
45+
os: windows-2022
46+
- target: x86_64-pc-windows-msvc
47+
os: windows-2022
48+
steps:
49+
- name: Install Linux system dependencies
50+
if: startsWith(matrix.os, 'ubuntu')
51+
run: sudo apt-get install libxcb1-dev libdbus-1-dev
52+
- name: Checkout repository
53+
uses: actions/checkout@v4
54+
- name: Install Rust toolchain
55+
uses: dtolnay/rust-toolchain@stable
56+
- uses: taiki-e/setup-cross-toolchain-action@v1
57+
with:
58+
target: ${{ matrix.target }}
59+
if: startsWith(matrix.os, 'ubuntu')
60+
- run: echo "RUSTFLAGS=${RUSTFLAGS} -C target-feature=+crt-static" >> "${GITHUB_ENV}"
61+
if: endsWith(matrix.target, 'windows-msvc')
62+
- uses: taiki-e/upload-rust-binary-action@v1
63+
with:
64+
token: ${{ secrets.GITHUB_TOKEN }}
65+
bin: tattoy
66+
target: ${{ matrix.target }}
67+
locked: true
68+
checksum: sha256
69+
70+
publish-deb:
71+
name: Publish Debian package
72+
runs-on: ubuntu-22.04
73+
steps:
74+
- name: Checkout
75+
uses: actions/checkout@v4
76+
- name: Install Rust toolchain
77+
uses: dtolnay/rust-toolchain@stable
78+
with:
79+
targets: x86_64-unknown-linux-gnu
80+
- name: Install `cargo-deb`
81+
uses: taiki-e/install-action@v2
82+
with:
83+
tool: cargo-deb
84+
- name: Build Debian package
85+
run: |
86+
cargo build --release --locked --package tattoy
87+
cargo-deb \
88+
--deb-revision="" \
89+
--strip \
90+
--package tattoy \
91+
--verbose \
92+
--output tattoy${{ github.ref_name }}.deb
93+
- name: Upload .deb to the release
94+
uses: svenstaro/upload-release-action@v2
95+
with:
96+
repo_token: ${{ secrets.GITHUB_TOKEN }}
97+
file: tattoy${{ github.ref_name }}.deb
98+
tag: ${{ github.ref_name }}
99+
100+
publish-rpm:
101+
name: Publish RPM package
102+
runs-on: ubuntu-22.04
103+
steps:
104+
- name: Checkout
105+
uses: actions/checkout@v4
106+
- name: Install Rust toolchain
107+
uses: dtolnay/rust-toolchain@stable
108+
with:
109+
targets: x86_64-unknown-linux-gnu
110+
- name: Install `cargo-deb`
111+
uses: taiki-e/install-action@v2
112+
with:
113+
tool: cargo-generate-rpm
114+
- name: Build RPM package
115+
run: |
116+
cargo build --release --locked --package tattoy
117+
cargo generate-rpm \
118+
--package tattoy \
119+
--output tattoy-${{ github.ref_name }}.x86_64.rpm
120+
- name: Upload the release
121+
uses: svenstaro/upload-release-action@v2
122+
with:
123+
repo_token: ${{ secrets.GITHUB_TOKEN }}
124+
file: tattoy-${{ github.ref_name }}.x86_64.rpm
125+
tag: ${{ github.ref }}

.github/workflows/cross-compile.yaml

Lines changed: 0 additions & 67 deletions
This file was deleted.

Cargo.toml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,9 @@ members = [
1010
"crates/tattoy-plugins/smokey_cursor",
1111
]
1212

13+
[profile.release]
14+
strip = "symbols"
15+
1316
[workspace.dependencies]
1417
color-eyre = "0.6.3"
1518
palette = "0.7.6"

crates/tattoy/Cargo.toml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,9 @@ description = "Eye-candy for your terminal"
44
version = "0.1.0"
55
edition = "2021"
66
readme = "README.md"
7-
repository = "TODO"
7+
repository = "https://github.com/tombh/tattoy"
88
license = "MIT"
9+
authors = ["Tom Buckley-Houston <[email protected]>"]
910
keywords = ["shell"]
1011
categories = ["shell"]
1112
default-run = "tattoy"

0 commit comments

Comments
 (0)