]> git.r.bdr.sh - rbdr/lyricli/commitdiff
Add sourcehut build
authorRuben Beltran del Rio <redacted>
Sun, 26 Jan 2025 15:59:20 +0000 (16:59 +0100)
committerRuben Beltran del Rio <redacted>
Sun, 26 Jan 2025 15:59:20 +0000 (16:59 +0100)
.build.yml [new file with mode: 0644]
.gitlab-ci.yml [deleted file]
Cargo.lock
Cargo.toml
Makefile

diff --git a/.build.yml b/.build.yml
new file mode 100644 (file)
index 0000000..f528c4e
--- /dev/null
@@ -0,0 +1,37 @@
+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
diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
deleted file mode 100644 (file)
index 04ec6ba..0000000
+++ /dev/null
@@ -1,14 +0,0 @@
-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
index 2800b09abc9c83d306d2fe30da7593badf32bd3d..7a47d682ae39de33a1a5aa05150a5df2fe93a348 100644 (file)
@@ -1,6 +1,6 @@
 # This file is automatically @generated by Cargo.
 # It is not intended for manual editing.
 # This file is automatically @generated by Cargo.
 # It is not intended for manual editing.
-version = 3
+version = 4
 
 [[package]]
 name = "addr2line"
 
 [[package]]
 name = "addr2line"
@@ -997,6 +997,15 @@ version = "0.1.5"
 source = "registry+https://github.com/rust-lang/crates.io-index"
 checksum = "ff011a302c396a5197692431fc1948019154afc178baf7d8e37367442a4601cf"
 
 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"
 [[package]]
 name = "openssl-sys"
 version = "0.9.101"
@@ -1005,6 +1014,7 @@ checksum = "dda2b0f344e78efc2facf7d195d098df0dd72151b26ab98da807afc26c198dff"
 dependencies = [
  "cc",
  "libc",
 dependencies = [
  "cc",
  "libc",
+ "openssl-src",
  "pkg-config",
  "vcpkg",
 ]
  "pkg-config",
  "vcpkg",
 ]
index cb0850dab7b9689ac453ce28b1fd1abf515e8e38..e2c8ce5730d2f34891c19e076b99ff530fccb03c 100644 (file)
@@ -14,7 +14,7 @@ path = "src/main.rs"
 [dependencies]
 clap = { version = "4.5.2", features = ["derive"] }
 percent-encoding = "2.3.1"
 [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"
 scraper = "0.19.0"
 serde = { version = "1.0.197", features = ["derive"] }
 serde_json = "1.0.114"
index 07cc42f01d45e60f465f3d1e026eae602a7eba71..b763d51136b1e6e993d5365c4987d3d181a7fe91 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -3,7 +3,6 @@ target = $(shell rustc -vV | grep host | awk '{print $$2}')
 architectures := x86_64-unknown-linux-gnu aarch64-unknown-linux-gnu
 app_name := lrc
 long_app_name := lyricli
 architectures := x86_64-unknown-linux-gnu aarch64-unknown-linux-gnu
 app_name := lrc
 long_app_name := lyricli
-host_architecture := $(target)
 
 default: build
 
 
 default: build
 
@@ -14,15 +13,20 @@ prepare:
        rustup target add $(target)
 
 build: prepare
        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)
 
        @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))
 
 release: rpm tar deb
        @$(eval filename := $(app_name)-$(target)-$(channel))
 
@@ -70,12 +74,11 @@ else
        $(MAKE) -e profile=release -e architectures='$(mac_architectures)' -e channel=$(tag) package
 endif
 
        $(MAKE) -e profile=release -e architectures='$(mac_architectures)' -e channel=$(tag) package
 endif
 
-
-ci:
+ci: lint coverage
 ifeq ($(GIT_REF),refs/heads/main)
 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)))
 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
 endif
 
 .PHONY: default build $(architectures) rpm package prepare set_rust ci release