--- /dev/null
+image: archlinux
+packages:
+ - make
+ - rsync
+ - coreutils
+ - lld
+ - rustup
+ - aarch64-linux-gnu-gcc
+ - tar
+ - gzip
+sources:
+ - git@git.sr.ht:~rbdr/lyricli
+secrets:
+ - 89d3b676-25d6-4942-8231-38b73aa62bf6
+ - 0b0d3e5e-fbdc-41d0-97ed-ee654fe797ff
+ - 51980156-3809-4f0e-993a-9c84fdf28b05
+tasks:
+ - set_rust: |
+ cd lyricli
+ make set_rust
+ - install_binstall: |
+ curl -L --proto '=https' --tlsv1.2 -sSf https://raw.githubusercontent.com/cargo-bins/cargo-binstall/main/install-from-binstall-release.sh | bash
+ - install_coverage_tool: |
+ cargo binstall cargo-tarpaulin --no-confirm
+ - install_builders: |
+ cargo binstall cargo-generate-rpm --no-confirm
+ cargo binstall cargo-deb --no-confirm
+ - configure_linker: |
+ cd lyricli
+ mkdir -p .cargo
+ echo '[target.aarch64-unknown-linux-gnu]' > .cargo/config.toml
+ echo 'linker = "aarch64-linux-gnu-gcc"' >> .cargo/config.toml
+ echo 'rustflags = ["-C", "link-arg=-fuse-ld=lld"]' >> .cargo/config.toml
+ - package: |
+ cd lyricli
+ cp ~/.lyricli.env .env
+ make ci
+++ /dev/null
-image: lyriclitest/swift:5.0.1
-
-stages:
- - lint
-
-cache:
- key: ${CI_COMMIT_REF_SLUG}-${CI_COMMIT_SHA}
- paths:
- - .build/
-
-lint:
- stage: lint
- script:
- - make lint
# This file is automatically @generated by Cargo.
# It is not intended for manual editing.
-version = 3
+version = 4
[[package]]
name = "addr2line"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "ff011a302c396a5197692431fc1948019154afc178baf7d8e37367442a4601cf"
+[[package]]
+name = "openssl-src"
+version = "300.4.1+3.4.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "faa4eac4138c62414b5622d1b31c5c304f34b406b013c079c2bbc652fdd6678c"
+dependencies = [
+ "cc",
+]
+
[[package]]
name = "openssl-sys"
version = "0.9.101"
dependencies = [
"cc",
"libc",
+ "openssl-src",
"pkg-config",
"vcpkg",
]
[dependencies]
clap = { version = "4.5.2", features = ["derive"] }
percent-encoding = "2.3.1"
-reqwest = { version = "0.11", features = ["json"] }
+reqwest = { version = "0.11", features = ["json", "native-tls", "native-tls-vendored"] }
scraper = "0.19.0"
serde = { version = "1.0.197", features = ["derive"] }
serde_json = "1.0.114"
architectures := x86_64-unknown-linux-gnu aarch64-unknown-linux-gnu
app_name := lrc
long_app_name := lyricli
-host_architecture := $(target)
default: build
rustup target add $(target)
build: prepare
-# I need an actually configurable way to make this work. Right now i'm only
-# cross compiling in the CI, and I know what I'm running, but
-ifeq ($(host_architecture), x86_64-unknown-linux-gnu)
-ifeq ($(target), aarch64-unknown-linux-gnu)
- LD_LIBRARY_PATH=/usr/local/aarch64-linux-gnu/lib:${LD_LIBRARY_PATH}
-endif
-endif
@export $$(cat .env | xargs) > /dev/null 2>&1 && cargo build --profile $(profile) --target $(target)
+test:
+ cargo test
+
+coverage:
+ cargo tarpaulin
+
+format:
+ cargo fmt && cargo clippy --fix
+
+lint:
+ cargo fmt -- --check && cargo clippy
+
release: rpm tar deb
@$(eval filename := $(app_name)-$(target)-$(channel))
$(MAKE) -e profile=release -e architectures='$(mac_architectures)' -e channel=$(tag) package
endif
-
-ci:
+ci: lint coverage
ifeq ($(GIT_REF),refs/heads/main)
- $(MAKE) -e profile=release -e channel=unstable $(target)
+ $(MAKE) -e profile=release -e channel=unstable package
else ifneq (,$(findstring refs/tags/,$(GIT_REF)))
- $(MAKE) -e profile=release -e channel=$(subst refs/tags/,,$(GIT_REF)) $(target)
+ $(MAKE) -e profile=release -e channel=$(subst refs/tags/,,$(GIT_REF)) package
endif
.PHONY: default build $(architectures) rpm package prepare set_rust ci release