Compare commits
No commits in common. "master" and "v1.0.1" have entirely different histories.
|
@ -1,18 +0,0 @@
|
||||||
on: push
|
|
||||||
jobs:
|
|
||||||
audit:
|
|
||||||
runs-on: docker
|
|
||||||
container:
|
|
||||||
image: forgejo.zenerdio.de/sebastian/apt-decoder-ci:v0.2.1
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v3
|
|
||||||
- uses: actions/cache@v3
|
|
||||||
with:
|
|
||||||
path: |
|
|
||||||
~/.cargo/bin/
|
|
||||||
~/.cargo/registry/index/
|
|
||||||
~/.cargo/registry/cache/
|
|
||||||
~/.cargo/git/db/
|
|
||||||
target/
|
|
||||||
key: audit-apt-decoder
|
|
||||||
- run: CARGO_HOME=/root/.cargo cargo audit
|
|
|
@ -1,55 +0,0 @@
|
||||||
on: push
|
|
||||||
jobs:
|
|
||||||
build:
|
|
||||||
runs-on: docker
|
|
||||||
container:
|
|
||||||
image: forgejo.zenerdio.de/sebastian/apt-decoder-ci:v0.2.1
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v3
|
|
||||||
- uses: actions/cache@v3
|
|
||||||
with:
|
|
||||||
path: |
|
|
||||||
~/.cargo/bin/
|
|
||||||
~/.cargo/registry/index/
|
|
||||||
~/.cargo/registry/cache/
|
|
||||||
~/.cargo/git/db/
|
|
||||||
target/
|
|
||||||
key: build-apt-decoder
|
|
||||||
restore-keys: audit-apt-decoder
|
|
||||||
- run: CARGO_HOME=~/.cargo cargo build --release
|
|
||||||
|
|
||||||
build-windows:
|
|
||||||
runs-on: docker
|
|
||||||
container:
|
|
||||||
image: forgejo.zenerdio.de/sebastian/apt-decoder-ci:v0.2.1
|
|
||||||
needs: build
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v3
|
|
||||||
- uses: actions/cache/restore@v3
|
|
||||||
with:
|
|
||||||
path: |
|
|
||||||
~/.cargo/bin/
|
|
||||||
~/.cargo/registry/index/
|
|
||||||
~/.cargo/registry/cache/
|
|
||||||
~/.cargo/git/db/
|
|
||||||
target/
|
|
||||||
key: build-apt-decoder
|
|
||||||
- run: CARGO_HOME=~/.cargo cargo build --target x86_64-pc-windows-gnu --release
|
|
||||||
|
|
||||||
build-appimage:
|
|
||||||
runs-on: docker
|
|
||||||
container:
|
|
||||||
image: forgejo.zenerdio.de/sebastian/apt-decoder-ci:v0.2.1
|
|
||||||
needs: build
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v3
|
|
||||||
- uses: actions/cache/restore@v3
|
|
||||||
with:
|
|
||||||
path: |
|
|
||||||
~/.cargo/bin/
|
|
||||||
~/.cargo/registry/index/
|
|
||||||
~/.cargo/registry/cache/
|
|
||||||
~/.cargo/git/db/
|
|
||||||
target/
|
|
||||||
key: build-apt-decoder
|
|
||||||
- run: CARGO_HOME=~/.cargo PATH=$PATH:$CARGO_HOME/bin x build -r --format appimage
|
|
|
@ -1,31 +0,0 @@
|
||||||
on:
|
|
||||||
push:
|
|
||||||
tags: 'v*'
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
publish-release:
|
|
||||||
runs-on: docker
|
|
||||||
container:
|
|
||||||
image: forgejo.zenerdio.de/sebastian/apt-decoder-ci:v0.2.1
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v3
|
|
||||||
- uses: actions/cache/restore@v3
|
|
||||||
with:
|
|
||||||
path: |
|
|
||||||
~/.cargo/bin/
|
|
||||||
~/.cargo/registry/index/
|
|
||||||
~/.cargo/registry/cache/
|
|
||||||
~/.cargo/git/db/
|
|
||||||
target/
|
|
||||||
key: build-apt-decoder
|
|
||||||
- run: CARGO_HOME=~/.cargo cargo build --target x86_64-pc-windows-gnu --release
|
|
||||||
- run: CARGO_HOME=~/.cargo PATH=$PATH:$CARGO_HOME/bin x build -r --format appimage
|
|
||||||
- run: mkdir -p release
|
|
||||||
- run: cp target/x/release/linux/x64/apt-decoder.AppImage release/apt-decoder-${{ github.ref_name }}.AppImage
|
|
||||||
- run: cp target/x86_64-pc-windows-gnu/release/apt-decoder.exe release/
|
|
||||||
- run: cd release && zip apt-decoder-win.zip apt-decoder.exe && rm apt-decoder.exe
|
|
||||||
- uses: actions/forgejo-release@v1
|
|
||||||
with:
|
|
||||||
direction: upload
|
|
||||||
release-dir: release
|
|
||||||
token: ${{ secrets.FORGEJO_RELEASE }}
|
|
|
@ -1,4 +1 @@
|
||||||
target
|
target
|
||||||
.vendor
|
|
||||||
*.AppImage
|
|
||||||
icon.png
|
|
||||||
|
|
|
@ -0,0 +1,56 @@
|
||||||
|
pipeline:
|
||||||
|
audit:
|
||||||
|
image: dbrgn/cargo-audit
|
||||||
|
commands:
|
||||||
|
- cargo audit
|
||||||
|
|
||||||
|
build:
|
||||||
|
image: rust:bullseye
|
||||||
|
commands:
|
||||||
|
- apt update && apt install -y libgtk-3-dev libxcb-shape0-dev
|
||||||
|
libxcb-xfixes0-dev
|
||||||
|
- cargo build --release
|
||||||
|
|
||||||
|
build_appimage:
|
||||||
|
image: rust:bullseye
|
||||||
|
group: build_release_files
|
||||||
|
commands:
|
||||||
|
- apt update && apt install -y libgtk-3-dev libxcb-shape0-dev
|
||||||
|
libxcb-xfixes0-dev python3-pip python3-setuptools patchelf
|
||||||
|
desktop-file-utils libgdk-pixbuf2.0-dev fakeroot strace fuse
|
||||||
|
# Install appimage tool
|
||||||
|
- (cd /tmp/ &&
|
||||||
|
wget https://github.com/AppImage/AppImageKit/releases/download/continuous/appimagetool-x86_64.AppImage &&
|
||||||
|
chmod +x appimagetool-x86_64.AppImage &&
|
||||||
|
./appimagetool-x86_64.AppImage --appimage-extract &&
|
||||||
|
cp -avr squashfs-root/usr/* /usr/)
|
||||||
|
- export CARGO_HOME=/root/.cargo
|
||||||
|
- cargo install cargo-appimage --version 1.4.0
|
||||||
|
# Build appimage
|
||||||
|
- cargo appimage
|
||||||
|
- mkdir -p release
|
||||||
|
- cp *.AppImage release/
|
||||||
|
|
||||||
|
build_windows:
|
||||||
|
image: rust:bullseye
|
||||||
|
group: build_release_files
|
||||||
|
commands:
|
||||||
|
- apt update && apt install -y mingw-w64 zip
|
||||||
|
- rustup target add x86_64-pc-windows-gnu
|
||||||
|
- rustup toolchain install stable-x86_64-pc-windows-gnu
|
||||||
|
- cargo build --target x86_64-pc-windows-gnu --release
|
||||||
|
- mkdir -p release
|
||||||
|
- cp target/x86_64-pc-windows-gnu/release/apt-decoder.exe release/
|
||||||
|
- cd release && zip apt-decoder-win.zip apt-decoder.exe && rm apt-decoder.exe
|
||||||
|
|
||||||
|
release:
|
||||||
|
image: plugins/gitea-release
|
||||||
|
settings:
|
||||||
|
files: release/*
|
||||||
|
api_key:
|
||||||
|
from_secret: api_key
|
||||||
|
base_url:
|
||||||
|
from_secret: base_url
|
||||||
|
secrets: [api_key, base_url]
|
||||||
|
when:
|
||||||
|
event: tag
|
File diff suppressed because it is too large
Load Diff
|
@ -4,12 +4,12 @@ version = "1.0.1"
|
||||||
authors = ["Sebastian <sebastian@sebastians-site.de>"]
|
authors = ["Sebastian <sebastian@sebastians-site.de>"]
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
clap = {version = "4.0.0", features = ["cargo"]}
|
clap = {version = "3.1.8", features = ["cargo"]}
|
||||||
indicatif = "0.16.2"
|
indicatif = "0.16.2"
|
||||||
hound = "3.4.0"
|
hound = "3.4.0"
|
||||||
image = "0.24.0"
|
image = "0.24.0"
|
||||||
eframe = {version = "0.18.0", optional = true}
|
eframe = {version = "0.18.0", optional = true}
|
||||||
rfd = "0.11.4"
|
rfd = "0.7.0"
|
||||||
thiserror = "1.0.30"
|
thiserror = "1.0.30"
|
||||||
|
|
||||||
|
|
||||||
|
|
51
src/main.rs
51
src/main.rs
|
@ -24,19 +24,30 @@ use clap::{arg, command};
|
||||||
#[cfg(not(feature = "ui"))]
|
#[cfg(not(feature = "ui"))]
|
||||||
fn main() {
|
fn main() {
|
||||||
let matches = command!()
|
let matches = command!()
|
||||||
.arg(arg!([wavfile] "Input wav file with 48kHz samplingrate").required(true))
|
.arg(
|
||||||
.arg(arg!([pngfile] "Output png file").default_value("output.png"))
|
arg!([wavfile] "Input wav file with 48kHz samplingrate")
|
||||||
|
.required(true)
|
||||||
|
.allow_invalid_utf8(true),
|
||||||
|
)
|
||||||
|
.arg(
|
||||||
|
arg!([pngfile] "Output png file")
|
||||||
|
.default_value("output.png")
|
||||||
|
.allow_invalid_utf8(true),
|
||||||
|
)
|
||||||
.get_matches();
|
.get_matches();
|
||||||
|
|
||||||
let input_file = matches
|
let input_file = matches
|
||||||
.get_one::<String>("wavfile")
|
.value_of_os("wavfile")
|
||||||
.expect("No input file given");
|
.expect("No input file given")
|
||||||
|
.to_str()
|
||||||
|
.unwrap();
|
||||||
let output_file = matches
|
let output_file = matches
|
||||||
.get_one::<String>("pngfile")
|
.value_of_os("pngfile")
|
||||||
.expect("No output file given");
|
.expect("No output file given")
|
||||||
|
.to_str()
|
||||||
|
.unwrap();
|
||||||
|
|
||||||
cli::decode(&input_file, &output_file);
|
cli::decode(input_file, output_file);
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(feature = "ui")]
|
#[cfg(feature = "ui")]
|
||||||
|
@ -48,21 +59,33 @@ use ui::DecoderApp;
|
||||||
#[cfg(feature = "ui")]
|
#[cfg(feature = "ui")]
|
||||||
fn main() {
|
fn main() {
|
||||||
let matches = command!()
|
let matches = command!()
|
||||||
.arg(arg!([wavfile] "Input wav file with 48kHz samplingrate").default_value("input.wav"))
|
.arg(
|
||||||
.arg(arg!([pngfile] "Output png file").default_value("output.png"))
|
arg!([wavfile] "Input wav file with 48kHz samplingrate")
|
||||||
.arg(arg!(-n --nogui "Disable gui and run in command line mode"))
|
.default_value("input.wav")
|
||||||
|
.allow_invalid_utf8(true),
|
||||||
|
)
|
||||||
|
.arg(
|
||||||
|
arg!([pngfile] "Output png file")
|
||||||
|
.default_value("output.png")
|
||||||
|
.allow_invalid_utf8(true),
|
||||||
|
)
|
||||||
|
.arg(arg!(-n --nogui ... "Disable gui and run in command line mode"))
|
||||||
.get_matches();
|
.get_matches();
|
||||||
|
|
||||||
let input_file = matches
|
let input_file = matches
|
||||||
.get_one::<String>("wavfile")
|
.value_of_os("wavfile")
|
||||||
.expect("No input file given")
|
.expect("No input file given")
|
||||||
|
.to_str()
|
||||||
|
.unwrap()
|
||||||
.to_string();
|
.to_string();
|
||||||
let output_file = matches
|
let output_file = matches
|
||||||
.get_one::<String>("pngfile")
|
.value_of_os("pngfile")
|
||||||
.expect("No output file given")
|
.expect("No output file given")
|
||||||
|
.to_str()
|
||||||
|
.unwrap()
|
||||||
.to_string();
|
.to_string();
|
||||||
|
|
||||||
if matches.get_flag("nogui") {
|
if matches.is_present("nogui") {
|
||||||
cli::decode(&input_file, &output_file);
|
cli::decode(&input_file, &output_file);
|
||||||
} else {
|
} else {
|
||||||
let native_options = eframe::NativeOptions::default();
|
let native_options = eframe::NativeOptions::default();
|
||||||
|
|
Loading…
Reference in New Issue