Skip to content

Commit

Permalink
Add cargo-deb workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
epilys committed Mar 27, 2023
1 parent 5f12788 commit 26c18cb
Show file tree
Hide file tree
Showing 6 changed files with 46 additions and 13 deletions.
20 changes: 14 additions & 6 deletions .github/workflows/builds.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,6 @@ env:
on:
workflow_dispatch:
push:
branches:
- 'main'
paths:
- 'src/**'
- 'Cargo.lock'
- 'Cargo.toml'
tags:
- v*

Expand Down Expand Up @@ -104,6 +98,7 @@ jobs:
run: |
set -ex
sudo apt install libgtk-3-dev
cargo install cargo-deb
- name: Build binary
run: |
cargo build --release
Expand All @@ -116,3 +111,16 @@ jobs:
path: target/gerb
if-no-files-found: error
retention-days: 30
- name: Build deb package
if: matrix.os == 'ubuntu-latest' && matrix.target == 'x86_64-unknown-linux-gnu'
shell: bash
run: |
cargo deb --target=${{ matrix.target }}
- name: Upload Artifacts
if: matrix.os == 'ubuntu-latest' && matrix.target == 'x86_64-unknown-linux-gnu'
uses: actions/upload-artifact@v2
with:
name: ${{ matrix.target }}-deb
path: target/${{ matrix.target }}/debian/*.deb
if-no-files-found: error
retention-days: 30
14 changes: 13 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ repository = "https://github.com/epilys/gerb"
keywords = ["font", "fonts", "editor", "ufo", "typography"]
categories = ["graphics"]
default-run = "gerb"
exclude = ["Makefile", "src/unicode/names/unicode.py", "/tests", "/docs", ".*", "CODE_OF_CONDUCT.md", "CONTRIBUTING.md", "DEVELOPMENT.md", "/*.py", "/*.png", "*.scss", "src/themes/**/README"]
exclude = ["Makefile", "src/unicode/names/unicode.py", "/tests", "/docs", "/dist", ".*", "CODE_OF_CONDUCT.md", "CONTRIBUTING.md", "DEVELOPMENT.md", "/*.py", "/*.png", "*.scss", "src/themes/**/README"]

[[bin]]
name = "gerb"
Expand Down Expand Up @@ -78,3 +78,15 @@ codegen-units = 1
opt-level = "s"
debug = false
strip = true

[package.metadata.deb]
maintainer = "Manos Pitsidianakis <manos@pitsidianak.is>"
copyright = "2022, Manos Pitsidianakis <manos@pitsidianak.is>"
depends = "$auto"
section = "graphics"
priority = "optional"
assets = [
["target/release/gerb", "usr/bin/", "755"],
["README.md", "usr/share/doc/gerb/README", "644"],
["dist/io.github.epilys.gerb.desktop", "usr/share/applications/io.github.epilys.gerb.desktop", "644"],
]
13 changes: 13 additions & 0 deletions dist/io.github.epilys.gerb.desktop
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
[Desktop Entry]
Version=1.0
Type=Application

Name=gerb
GenericName=Font Editor
GenericName[el_GR]=Πρόγραμμα σχεδίασης γραμματοσειρών
Categories=Graphics;GTK;
Keywords=ufo;typography;design

Icon=gerb
Exec=gerb
Terminal=false
2 changes: 1 addition & 1 deletion src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ pub fn get_git_sha() -> std::borrow::Cow<'static, str> {
}

pub const APPLICATION_NAME: &str = "gerb";
pub const APPLICATION_ID: &str = "com.epilys.gerb";
pub const APPLICATION_ID: &str = "io.github.epilys.gerb";
pub const ISSUE_TRACKER: &str = "https://github.com/epilys/gerb/issues";
pub const VERSION_INFO: &str = build_info::format!("{}", $.crate_info.version);
pub const BUILD_INFO: &str = build_info::format!("{}\t{}\t{}\t{}", $.crate_info.version, $.compiler, $.timestamp, $.crate_info.enabled_features);
Expand Down
8 changes: 4 additions & 4 deletions src/ufo.rs
Original file line number Diff line number Diff line change
Expand Up @@ -949,7 +949,7 @@ fn test_metainfo_plist_parse() {
<plist version="1.0">
<dict>
<key>creator</key>
<string>com.epilys.gerb</string>
<string>io.github.epilys.gerb</string>
<key>formatVersion</key>
<integer>3</integer>
<key>formatVersionMinor</key>
Expand Down Expand Up @@ -1156,7 +1156,7 @@ fn test_lib_plist_parse() {
"http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>com.epilys.gerb</key>
<key>io.github.epilys.gerb</key>
<string>Hello World.</string>
<key>public.glyphOrder</key>
<array>
Expand Down Expand Up @@ -1185,14 +1185,14 @@ fn test_lib_plist_parse() {
assert_eq!(
&l.values.keys().cloned().collect::<Vec<String>>(),
&[
"com.epilys.gerb",
crate::APPLICATION_ID,
"public.glyphOrder",
"public.unicodeVariationSequences"
]
);

assert_eq!(
&l.values["com.epilys.gerb"],
&l.values[crate::APPLICATION_ID],
&plist::Value::String("Hello World.".to_string())
);
assert_eq!(
Expand Down
2 changes: 1 addition & 1 deletion src/ufo/ufo2to3.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ def ufo2to3(options):
shutil.copytree(ufo2_path, tmpdirname, dirs_exist_ok=True)
reader = UFOReader(tmpdirname)
writer = UFOWriter(
ufo3_path, formatVersion=(3, 0), fileCreator="com.epilys.gerb"
ufo3_path, formatVersion=(3, 0), fileCreator="io.github.epilys.gerb"
)
writer.writeKerning(deepcopy(reader.readKerning()))
writer.writeGroups(deepcopy(reader.readGroups()))
Expand Down

0 comments on commit 26c18cb

Please sign in to comment.