diff --git a/.cargo/config b/.cargo/config.toml
similarity index 53%
rename from .cargo/config
rename to .cargo/config.toml
index f6a4c66..8fa5432 100644
--- a/.cargo/config
+++ b/.cargo/config.toml
@@ -1,17 +1,6 @@
-# This file is part of depi.
-#
-# depi is free software: you can redistribute it and/or modify
-# it under the terms of the GNU Affero General Public License as published by
-# the Free Software Foundation, either version 3 of the License, or
-# (at your option) any later version.
-#
-# depi is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU Affero General Public License for more details.
-#
-# You should have received a copy of the GNU Affero General Public License
-# along with depi. If not, see .
+[doc.extern-map.registries]
+crates-io = "https://docs.rs/"
+
[target.aarch64-apple-darwin]
rustflags = ["-C", "target-cpu=native", "-Z", "tune-cpu=native", "-C", "strip=symbols", "-Z", "unstable-options"]
diff --git a/.github/workflows/aarch64.yml b/.github/workflows/aarch64.yml
deleted file mode 100644
index de44838..0000000
--- a/.github/workflows/aarch64.yml
+++ /dev/null
@@ -1,46 +0,0 @@
-on:
- push:
- branches:
- - 'master'
-
-name: 'Build: GNU + Linux (ARM64)'
-
-jobs:
- linux_aarch64:
- name: GNU + Linux (ARM64)
- runs-on: ubuntu-latest
- steps:
- - name: Checkout codebase
- uses: actions/checkout@v3
- - name: Install development dependencies
- run: |
- sudo apt-get update > /dev/null
- sudo apt-get install -qq libssl-dev build-essential > /dev/null
- - name: Setup Rust toolchain
- uses: actions-rs/toolchain@v1
- with:
- toolchain: nightly
- target: aarch64-unknown-linux-gnu
- default: true
- profile: minimal
- - name: Build depi
- uses: actions-rs/cargo@v1
- with:
- use-cross: true
- command: build
- args: --release --target aarch64-unknown-linux-gnu
- - name: Prepare depi for upload
- run: |
- cd ./target/aarch64-unknown-linux-gnu/release/
- strip -v --strip-all ./libdepi.a
- chmod +x ./depi
- tar -cvf aarch64-depi.gnu+linux.tar \
- depi \
- libdepi.so \
- libdepi.a
- - name: Upload depi build artifacts to GitHub
- uses: actions/upload-artifact@v3
- with:
- name: aarch64-depi.gnu+linux
- path: ./target/aarch64-unknown-linux-gnu/release/aarch64-depi.gnu+linux.tar
- if-no-files-found: error
diff --git a/.github/workflows/annotate_code.yml b/.github/workflows/annotate_code.yml
deleted file mode 100644
index 56072a5..0000000
--- a/.github/workflows/annotate_code.yml
+++ /dev/null
@@ -1,17 +0,0 @@
-on: push
-name: Annotate code
-jobs:
- clippy_check:
- name: Annotate code
- runs-on: ubuntu-latest
- steps:
- - uses: actions/checkout@v3
- - uses: actions-rs/toolchain@v1
- with:
- toolchain: nightly
- components: clippy
- override: true
- - uses: actions-rs/clippy-check@v1
- with:
- token: ${{ secrets.GITHUB_TOKEN }}
- args: --all-features
\ No newline at end of file
diff --git a/.github/workflows/audit_on_change.yml b/.github/workflows/audit_on_change.yml
deleted file mode 100644
index 0adf55c..0000000
--- a/.github/workflows/audit_on_change.yml
+++ /dev/null
@@ -1,17 +0,0 @@
-name: Dependency security audit (on change)
-on:
- push:
- branches:
- - 'master'
- paths:
- - '**/Cargo.toml'
- - '**/Cargo.lock'
-jobs:
- security_audit:
- name: Security audit
- runs-on: ubuntu-latest
- steps:
- - uses: actions/checkout@v3
- - uses: actions-rs/audit-check@v1
- with:
- token: ${{ secrets.GITHUB_TOKEN }}
\ No newline at end of file
diff --git a/.github/workflows/aur.yml b/.github/workflows/aur.yml
deleted file mode 100644
index 05e234f..0000000
--- a/.github/workflows/aur.yml
+++ /dev/null
@@ -1,84 +0,0 @@
-on:
- release:
- types: [published]
-
-name: 'Package: AUR Binary (x86_64)'
-
-jobs:
- aur_x86-64:
- name: Arch Linux (x86_64)
- runs-on: ubuntu-latest
- container:
- image: archlinux:latest
- volumes:
- - /proc:/proc
- - /sys/fs/cgroup/systemd/actions_job:/sys/fs/cgroup/systemd/actions_job
- - /sys/fs/cgroup:/sys/fs/cgroup
- options: --privileged
- steps:
- - name: Checkout codebase
- uses: actions/checkout@v3
- - name: Install compiler toolchain
- run: |
- pacman -Syu gcc git openssh openssl base-devel --noconfirm
- - name: Setup Rust toolchain
- uses: actions-rs/toolchain@v1
- with:
- toolchain: nightly
- target: x86_64-unknown-linux-gnu
- default: true
- profile: minimal
- - name: Install 'cargo-aur'
- uses: actions-rs/cargo@v1
- with:
- command: install
- args: cargo-aur
- - name: Generate AUR binary package
- uses: actions-rs/cargo@v1
- with:
- command: aur
- - name: Setup SSH authentication details
- run: |
- mkdir -p /root/.ssh
-
- tee -a /root/.ssh/aur > /dev/null < /dev/null < /dev/null <> /root/.ssh/known_hosts
- - name: Upload depi Pacman package
- uses: actions/upload-artifact@v3
- with:
- name: x86_64-depi.pacman
- path: depi-*-x86_64.tar.gz
- if-no-files-found: error
- - name: Prepare to drop out of superuser access
- run: |
- systemd-machine-id-setup
- tee -a /etc/sudoers > /dev/null < .SRCINFO
- git add -A
- git commit -m "Automatically updating depi package via GitHub Actions (see repository for release notes)"
- git push origin HEAD:master
diff --git a/.github/workflows/check_code.yml b/.github/workflows/check_code.yml
deleted file mode 100644
index f8ff090..0000000
--- a/.github/workflows/check_code.yml
+++ /dev/null
@@ -1,30 +0,0 @@
-on:
- push:
- branches:
- - 'master'
-
-name: Evaluate codebase
-
-jobs:
- code_check:
- name: Evaluate codebase
- runs-on: ubuntu-latest
- steps:
- - name: Checkout codebase
- uses: actions/checkout@v3
- - name: Setup Rust toolchain
- uses: actions-rs/toolchain@v1
- with:
- toolchain: nightly
- components: clippy, rustfmt
- profile: minimal
- - name: Check codebase is properly formatted
- uses: actions-rs/cargo@v1
- with:
- command: fmt
- args: -- --check
- - name: Check codebase using linter
- uses: actions-rs/cargo@v1
- with:
- command: clippy
- args: --all-targets -- -D warnings
\ No newline at end of file
diff --git a/.github/workflows/coverage.yml b/.github/workflows/coverage.yml
deleted file mode 100644
index 4dd76ed..0000000
--- a/.github/workflows/coverage.yml
+++ /dev/null
@@ -1,42 +0,0 @@
-on:
- push:
- branches:
- - 'master'
-
-name: Code coverage
-
-jobs:
- codecovio:
- name: Code coverage
- runs-on: ubuntu-latest
- steps:
- - name: Checkout repository
- uses: actions/checkout@v3
-
- - name: Setup Rust toolchain
- uses: actions-rs/toolchain@v1
- with:
- toolchain: nightly
- default: true
-
- - name: Run cargo-tarpaulin
- uses: actions-rs/tarpaulin@v0.1
- with:
- args: '--out Lcov'
-
- - name: Upload to codecov.io
- uses: codecov/codecov-action@v3.1.1
- with:
- token: ${{secrets.CODECOV_TOKEN}}
-
- - name: Upload to Coveralls
- uses: coverallsapp/github-action@master
- with:
- github-token: ${{ secrets.GITHUB_TOKEN }}
- path-to-lcov: './lcov.info'
-
- - name: Archive code coverage results
- uses: actions/upload-artifact@v3
- with:
- name: code-coverage-report
- path: cobertura.xml
\ No newline at end of file
diff --git a/.github/workflows/deb.yml b/.github/workflows/deb.yml
deleted file mode 100644
index 878383a..0000000
--- a/.github/workflows/deb.yml
+++ /dev/null
@@ -1,41 +0,0 @@
-on:
- push:
- branches:
- - 'master'
-
-name: 'Package: Debian GNU + Linux (x86_64)'
-
-jobs:
- deb_x86-64:
- name: Debian GNU + Linux (x86_64)
- runs-on: ubuntu-latest
- steps:
- - name: Checkout codebase
- uses: actions/checkout@v3
- - name: Install development dependencies
- run: |
- sudo apt-get update > /dev/null
- sudo apt-get install -qq libssl-dev build-essential > /dev/null
- - name: Setup Rust toolchain
- uses: actions-rs/toolchain@v1
- with:
- toolchain: nightly
- target: x86_64-unknown-linux-gnu
- default: true
- profile: minimal
- - name: Install 'cargo-deb'
- uses: actions-rs/cargo@v1
- with:
- command: install
- args: cargo-deb
- - name: Build & package depi
- uses: actions-rs/cargo@v1
- with:
- command: deb
- args: --separate-debug-symbols -- --target x86_64-unknown-linux-gnu
- - name: Upload depi build artifact to GitHub
- uses: actions/upload-artifact@v3
- with:
- name: x86_64-depi.deb.gnu+linux
- path: ./target/debian/depi_*_amd64.deb
- if-no-files-found: error
\ No newline at end of file
diff --git a/.github/workflows/devskim.yml b/.github/workflows/devskim.yml
deleted file mode 100644
index 500135e..0000000
--- a/.github/workflows/devskim.yml
+++ /dev/null
@@ -1,34 +0,0 @@
-# This workflow uses actions that are not certified by GitHub.
-# They are provided by a third-party and are governed by
-# separate terms of service, privacy policy, and support
-# documentation.
-
-name: DevSkim
-
-on:
- push:
- branches: [ "master" ]
- pull_request:
- branches: [ "master" ]
- schedule:
- - cron: '33 20 * * 4'
-
-jobs:
- lint:
- name: DevSkim
- runs-on: ubuntu-20.04
- permissions:
- actions: read
- contents: read
- security-events: write
- steps:
- - name: Checkout code
- uses: actions/checkout@v3
-
- - name: Run DevSkim scanner
- uses: microsoft/DevSkim-Action@v1
-
- - name: Upload DevSkim scan results to GitHub Security tab
- uses: github/codeql-action/upload-sarif@v2
- with:
- sarif_file: devskim-results.sarif
diff --git a/.github/workflows/fix_code.yml b/.github/workflows/fix_code.yml
deleted file mode 100644
index e162431..0000000
--- a/.github/workflows/fix_code.yml
+++ /dev/null
@@ -1,33 +0,0 @@
-on:
- push:
- branches:
- - 'master'
-
-name: Revise codebase
-
-jobs:
- code_fix:
- name: Revise codebase
- runs-on: ubuntu-latest
- steps:
- - name: Checkout codebase
- uses: actions/checkout@v3
- with:
- token: ${{ secrets.GITHUB_TOKEN }}
- - name: Setup Rust toolchain
- uses: actions-rs/toolchain@v1
- with:
- toolchain: nightly
- profile: minimal
- components: clippy, rustfmt
- - name: Revise code files
- uses: actions-rs/cargo@v1
- with:
- command: fix
- args: --edition --edition-idioms
- - name: Commit changes to code, if any
- run: |
- git config --global user.name 'depi'
- git config --global user.email 'Dirout@users.noreply.github.com'
- git diff --quiet && git diff --staged --quiet || git commit -am "Automatically apply compiler suggestions"
- git push
\ No newline at end of file
diff --git a/.github/workflows/format_code.yml b/.github/workflows/format_code.yml
deleted file mode 100644
index f69cb00..0000000
--- a/.github/workflows/format_code.yml
+++ /dev/null
@@ -1,32 +0,0 @@
-on:
- push:
- branches:
- - 'master'
-
-name: Format codebase
-
-jobs:
- code_format:
- name: Format codebase
- runs-on: ubuntu-latest
- steps:
- - name: Checkout codebase
- uses: actions/checkout@v3
- with:
- token: ${{ secrets.GITHUB_TOKEN }}
- - name: Setup Rust toolchain
- uses: actions-rs/toolchain@v1
- with:
- toolchain: nightly
- profile: minimal
- components: clippy, rustfmt
- - name: Format code files
- uses: actions-rs/cargo@v1
- with:
- command: fmt
- - name: Commit changes to code, if any
- run: |
- git config --global user.name 'depi'
- git config --global user.email 'Dirout@users.noreply.github.com'
- git diff --quiet && git diff --staged --quiet || git commit -am "Automatically enforce Rust styleguide"
- git push
\ No newline at end of file
diff --git a/.github/workflows/gh-pages.yml b/.github/workflows/gh-pages.yml
deleted file mode 100644
index 8bc5859..0000000
--- a/.github/workflows/gh-pages.yml
+++ /dev/null
@@ -1,52 +0,0 @@
-name: Publish documentation to GitHub Pages
-on:
- push:
- branches:
- - 'master'
-jobs:
- build:
- runs-on: ubuntu-latest
- name: "Publish documentation"
- steps:
- - name: Setup Rust toolchain
- uses: actions-rs/toolchain@v1
- with:
- toolchain: nightly
- target: x86_64-unknown-linux-gnu
- default: true
- profile: default
- - name: Checkout codebase
- uses: actions/checkout@v3
- with:
- path: ./depi
- - name: Checkout GitHub Pages environment
- uses: actions/checkout@v3
- with:
- ref: gh-pages
- path: ./gh-pages
- token: ${{ secrets.GITHUB_TOKEN }}
- - name: Generate documentation
- run: |
- sudo apt-get -qq install tree > /dev/null
- printf "Codebase:\n" && tree ./depi
- find ./gh-pages -mindepth 1 ! -regex '^./gh-pages/.git\(/.*\)?' -delete
-
- cd ./depi
- printf "\nGenerating documentation … "
- time cargo doc --no-deps --document-private-items --release --quiet
- cd ../
-
- cp -ar ./depi/target/doc/* ./gh-pages
- touch ./gh-pages/.nojekyll
- tee -a ./gh-pages/.nojekyll > /dev/null < /dev/null
- brew install openssl openssl@1.1 > /dev/null
- - name: Setup Rust toolchain for AMD64
- uses: actions-rs/toolchain@v1
- with:
- toolchain: nightly
- target: x86_64-apple-darwin
- default: true
- profile: minimal
- - name: Setup Rust toolchain for ARM64
- uses: actions-rs/toolchain@v1
- with:
- toolchain: nightly
- target: aarch64-apple-darwin
- default: false
- profile: minimal
- - name: Build depi for AMD64
- uses: actions-rs/cargo@v1
- with:
- use-cross: false
- command: build
- args: --release --target x86_64-apple-darwin --all-features
- - name: Build depi for AARCH64
- run: |
- SDKROOT=$(xcrun -sdk macosx --show-sdk-path) \
- MACOSX_DEPLOYMENT_TARGET=$(xcrun -sdk macosx --show-sdk-platform-version) \
- cargo build --release --target=aarch64-apple-darwin --all-features
- - name: Prepare depi for upload
- run: |
- lipo -create \
- -output target/depi \
- target/aarch64-apple-darwin/release/depi \
- target/x86_64-apple-darwin/release/depi
- lipo -create \
- -output target/libdepi.dylib \
- target/aarch64-apple-darwin/release/libdepi.dylib \
- target/x86_64-apple-darwin/release/libdepi.dylib
- lipo -create \
- -output target/libdepi.a \
- target/aarch64-apple-darwin/release/libdepi.a \
- target/x86_64-apple-darwin/release/libdepi.a
- cd ./target
- tar -cvf universal-depi.osx.tar \
- depi \
- libdepi.dylib \
- libdepi.a
-
- cd ./x86_64-apple-darwin/release/
- tar -cvf x86_64-depi.osx.tar \
- depi \
- libdepi.dylib \
- libdepi.a
-
- cd ../../aarch64-apple-darwin/release/
- strip ./depi
- chmod +x ./depi
- tar -cvf aarch64-depi.osx.tar \
- depi \
- libdepi.dylib \
- libdepi.a
- - name: Upload depi AMD64 build artifacts to GitHub
- uses: actions/upload-artifact@v3
- with:
- name: x86_64-depi.osx
- path: ./target/x86_64-apple-darwin/release/x86_64-depi.osx.tar
- if-no-files-found: error
- - name: Upload depi ARM64 build artifacts to GitHub
- uses: actions/upload-artifact@v3
- with:
- name: aarch64-depi.osx
- path: ./target/aarch64-apple-darwin/release/aarch64-depi.osx.tar
- if-no-files-found: error
- - name: Upload depi Universal build artifacts to GitHub
- uses: actions/upload-artifact@v3
- with:
- name: universal-depi.osx
- path: ./target/universal-depi.osx.tar
- if-no-files-found: error
\ No newline at end of file
diff --git a/.github/workflows/publish_crate.yml b/.github/workflows/publish_crate.yml
deleted file mode 100644
index 644790f..0000000
--- a/.github/workflows/publish_crate.yml
+++ /dev/null
@@ -1,35 +0,0 @@
-on:
- release:
- types: [published]
-
-name: 'Publish: crates.io'
-
-jobs:
- publish:
- name: 'Publish: crates.io'
- runs-on: ubuntu-latest
- steps:
- - name: Fetch dependencies
- run: |
- sudo apt-get update > /dev/null
- sudo apt-get install -qq libsixel-dev libsixel-bin libssl-dev build-essential > /dev/null
- - name: Checkout codebase
- uses: actions/checkout@v3
- - name: Setup Rust toolchain
- uses: actions-rs/toolchain@v1
- with:
- toolchain: nightly
- profile: minimal
- - name: Login to crates.io
- uses: actions-rs/cargo@v1
- with:
- command: login
- args: ${{ secrets.NEW_CRATES_LOGIN }}
- - name: Package depi
- uses: actions-rs/cargo@v1
- with:
- command: package
- - name: Publish depi
- uses: actions-rs/cargo@v1
- with:
- command: publish
\ No newline at end of file
diff --git a/.github/workflows/rpm.yml b/.github/workflows/rpm.yml
deleted file mode 100644
index 4f0e8b0..0000000
--- a/.github/workflows/rpm.yml
+++ /dev/null
@@ -1,64 +0,0 @@
-on:
- push:
- branches:
- - 'master'
-
-name: 'Package: RPM for GNU + Linux (x86_64)'
-
-jobs:
- rpm_x86-64:
- name: Fedora GNU + Linux (x86_64)
- runs-on: ubuntu-latest
- container:
- image: fedora:latest
- volumes:
- - /proc:/proc
- - /sys/fs/cgroup/systemd/actions_job:/sys/fs/cgroup/systemd/actions_job
- - /sys/fs/cgroup:/sys/fs/cgroup
- options: --privileged
- steps:
- - name: Install requisite packages
- run: |
- sudo dnf -q -y update > /dev/null
- sudo dnf -q -y install git gh gcc rpm-build rpmdevtools rpmlint python3-rust2rpm rust-packaging rust cargo tree openssl openssl-devel perl perl-FindBin perl-lib > /dev/null
- - name: Checkout codebase
- run: |
- printf "${{ secrets.PAT }}" | gh auth login --with-token
- gh repo clone Dirout/depi
- cd ./depi
- printf "Repository:\n" && tree -a ./
- - name: Setup Rust toolchain
- uses: actions-rs/toolchain@v1
- with:
- toolchain: nightly
- target: x86_64-unknown-linux-gnu
- default: true
- profile: minimal
- - name: Generate RPM package specification
- run: |
- cd ./depi
- rust2rpm .
- rpmlint ./rust-depi.spec
- printf "Repository:\n" && tree -a ./
- - name: Commit changes to RPM package specification file, if any
- run: |
- cd ./depi
- git config --global --add safe.directory ./
- git config --global user.name 'depi'
- git config --global user.email 'Dirout@users.noreply.github.com'
- git add ./rust-depi.spec
- git diff --quiet && git diff --staged --quiet || git commit -am "Automatically updated RPM package specification"
- git push https://${{ secrets.PAT }}@github.com/Dirout/depi.git
- - name: Build & package depi
- run: |
- cd ./depi
- cargo install cargo-generate-rpm
- cargo build --release --all-features
- cargo generate-rpm
- tree -a ./
- - name: Upload depi package to GitHub
- uses: actions/upload-artifact@v3
- with:
- name: x86_64-depi.rpm.gnu+linux
- path: "./depi/target/generate-rpm/*.rpm"
- if-no-files-found: error
\ No newline at end of file
diff --git a/.github/workflows/rust-clippy.yml b/.github/workflows/rust-clippy.yml
deleted file mode 100644
index 4204b61..0000000
--- a/.github/workflows/rust-clippy.yml
+++ /dev/null
@@ -1,55 +0,0 @@
-# This workflow uses actions that are not certified by GitHub.
-# They are provided by a third-party and are governed by
-# separate terms of service, privacy policy, and support
-# documentation.
-# rust-clippy is a tool that runs a bunch of lints to catch common
-# mistakes in your Rust code and help improve your Rust code.
-# More details at https://github.com/rust-lang/rust-clippy
-# and https://rust-lang.github.io/rust-clippy/
-
-name: rust-clippy analyze
-
-on:
- push:
- branches: [ "master" ]
- pull_request:
- # The branches below must be a subset of the branches above
- branches: [ "master" ]
- schedule:
- - cron: '18 4 * * 5'
-
-jobs:
- rust-clippy-analyze:
- name: Run rust-clippy analyzing
- runs-on: ubuntu-latest
- permissions:
- contents: read
- security-events: write
- actions: read # only required for a private repository by github/codeql-action/upload-sarif to get the Action run status
- steps:
- - name: Checkout code
- uses: actions/checkout@v3
-
- - name: Install Rust toolchain
- uses: actions-rs/toolchain@16499b5e05bf2e26879000db0c1d13f7e13fa3af #@v1
- with:
- profile: minimal
- toolchain: stable
- components: clippy
- override: true
-
- - name: Install required cargo
- run: cargo install clippy-sarif sarif-fmt
-
- - name: Run rust-clippy
- run:
- cargo clippy
- --all-features
- --message-format=json | clippy-sarif | tee rust-clippy-results.sarif | sarif-fmt
- continue-on-error: true
-
- - name: Upload analysis results to GitHub
- uses: github/codeql-action/upload-sarif@v2
- with:
- sarif_file: rust-clippy-results.sarif
- wait-for-processing: true
diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml
new file mode 100644
index 0000000..ac43e53
--- /dev/null
+++ b/.github/workflows/rust.yml
@@ -0,0 +1,69 @@
+name: Rust
+on:
+ push:
+ branches: [ "master" ]
+env:
+ CARGO_TERM_COLOR: always
+jobs:
+ build_documentation:
+ name: Build documentation
+ runs-on: ubuntu-latest
+ steps:
+ - name: Setup Rust toolchain
+ uses: actions-rs/toolchain@v1
+ with:
+ toolchain: nightly
+ target: x86_64-unknown-linux-gnu
+ default: true
+ profile: default
+ - name: Checkout codebase
+ uses: actions/checkout@v4
+ - name: Generate documentation
+ run: time cargo doc --no-deps -Zrustdoc-map --all-features --release --quiet
+ - name: Fix permissions
+ run: |
+ chmod -c -R +rX "target/doc/" | while read line; do
+ echo "::warning title=Invalid file permissions automatically fixed::$line"
+ done
+ - name: Upload Pages artifact
+ uses: actions/upload-pages-artifact@v3
+ with:
+ path: "target/doc/"
+ deploy_documentation:
+ needs: build_documentation
+ name: Deploy documentation to GitHub Pages
+ permissions:
+ pages: write
+ id-token: write
+ environment:
+ name: github-pages
+ url: ${{ steps.deployment.outputs.page_url }}
+ runs-on: ubuntu-latest
+ steps:
+ - name: Deploy to GitHub Pages
+ id: deployment
+ uses: actions/deploy-pages@v4
+ apply_suggestions:
+ name: Format code, apply compiler suggestions
+ runs-on: ubuntu-latest
+ steps:
+ - name: Checkout codebase
+ uses: actions/checkout@v4
+ - name: Setup Rust toolchain
+ uses: actions-rs/toolchain@v1
+ with:
+ toolchain: nightly
+ components: clippy, rustfmt
+ profile: minimal
+ - name: Format
+ run: cargo fmt
+ - name: Apply compiler suggestions
+ run: |
+ cargo fix --all-features --edition --edition-idioms
+ cargo clippy --fix -Z unstable-options
+ - name: Commit changes to code, if any
+ run: |
+ git config user.name github-actions
+ git config user.email github-actions@github.com
+ git diff --quiet && git diff --staged --quiet || git commit -am "chore: Format and apply compiler suggestions."
+ git push
\ No newline at end of file
diff --git a/.github/workflows/scheduled_audit.yml b/.github/workflows/scheduled_audit.yml
deleted file mode 100644
index e107931..0000000
--- a/.github/workflows/scheduled_audit.yml
+++ /dev/null
@@ -1,13 +0,0 @@
-name: Dependency security audit (scheduled)
-on:
- schedule:
- - cron: '0 0 * * *'
-jobs:
- scheduled_security_audit:
- name: Security audit
- runs-on: ubuntu-latest
- steps:
- - uses: actions/checkout@v3
- - uses: actions-rs/audit-check@v1
- with:
- token: ${{ secrets.GITHUB_TOKEN }}
\ No newline at end of file
diff --git a/.github/workflows/shiftleft_analysis.yml b/.github/workflows/shiftleft_analysis.yml
deleted file mode 100644
index 10cb776..0000000
--- a/.github/workflows/shiftleft_analysis.yml
+++ /dev/null
@@ -1,40 +0,0 @@
-# This workflow integrates Scan with GitHub's code scanning feature
-# Scan is a free open-source security tool for modern DevOps teams from ShiftLeft
-# Visit https://slscan.io/en/latest/integrations/code-scan for help
-name: SL Scan
-
-# This section configures the trigger for the workflow. Feel free to customize depending on your convention
-on:
- push:
- branches:
- - 'master'
-
-jobs:
- Scan-Build:
- name: Scan
- # Scan runs on ubuntu, mac and windows
- runs-on: ubuntu-latest
- steps:
- - uses: actions/checkout@v3
- # Instructions
- # 1. Setup JDK, Node.js, Python etc depending on your project type
- # 2. Compile or build the project before invoking scan
- # Example: mvn compile, or npm install or pip install goes here
- # 3. Invoke Scan with the github token. Leave the workspace empty to use relative url
-
- - name: Perform Scan
- uses: ShiftLeftSecurity/scan-action@master
- env:
- WORKSPACE: ""
- GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- SCAN_AUTO_BUILD: true
- with:
- output: reports
- # Scan auto-detects the languages in your project. To override uncomment the below variable and set the type
- # type: credscan,java
- # type: python
-
- - name: Upload report
- uses: github/codeql-action/upload-sarif@v2
- with:
- sarif_file: reports
diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml
deleted file mode 100644
index ddec62a..0000000
--- a/.github/workflows/tests.yml
+++ /dev/null
@@ -1,35 +0,0 @@
-on:
- push:
- branches:
- - 'master'
-
-name: 'Tests'
-
-jobs:
- tests:
- name: Tests
- runs-on: ubuntu-latest
- steps:
- - name: Checkout codebase
- uses: actions/checkout@v3
- - name: Install development dependencies
- run: |
- sudo apt-get update > /dev/null
- sudo apt-get install -qq build-essential > /dev/null
- - name: Setup Rust toolchain
- uses: actions-rs/toolchain@v1
- with:
- toolchain: nightly
- target: x86_64-unknown-linux-gnu
- default: true
- profile: minimal
- - name: Execute unit tests
- uses: actions-rs/cargo@v1
- with:
- command: test
- args: -p depi --all-targets --all-features --future-incompat-report
- - name: Execute documentation tests
- uses: actions-rs/cargo@v1
- with:
- command: test
- args: --doc -p depi --all-features --future-incompat-report -- --show-output
\ No newline at end of file
diff --git a/.github/workflows/update_deps.yml b/.github/workflows/update_deps.yml
deleted file mode 100644
index fe4ffbe..0000000
--- a/.github/workflows/update_deps.yml
+++ /dev/null
@@ -1,43 +0,0 @@
-on:
- schedule:
- - cron: '0 0 * * 0'
-
-name: Update dependencies
-
-jobs:
- code_check:
- name: Update dependencies
- runs-on: ubuntu-latest
- steps:
- - name: Checkout codebase
- uses: actions/checkout@v3
- - name: Setup Rust toolchain
- uses: actions-rs/toolchain@v1
- with:
- toolchain: nightly
- components: clippy, rustfmt
- profile: minimal
- - name: Install 'cargo-edit'
- uses: actions-rs/cargo@v1
- with:
- command: install
- args: cargo-edit
- - name: Upgrade dependencies
- uses: actions-rs/cargo@v1
- with:
- command: upgrade
- - name: Update lock file
- uses: actions-rs/cargo@v1
- with:
- command: update
- - name: Check if code still compiles
- uses: actions-rs/cargo@v1
- with:
- command: check
- args: --all-targets --release
- - name: Commit changes, if any
- run: |
- git config --global user.name 'depi'
- git config --global user.email 'Dirout@users.noreply.github.com'
- git diff --quiet && git diff --staged --quiet || git commit -am "Automatically update dependencies"
- git push
\ No newline at end of file
diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml
deleted file mode 100644
index 4f5f298..0000000
--- a/.github/workflows/windows.yml
+++ /dev/null
@@ -1,60 +0,0 @@
-on:
- push:
- branches:
- - 'master'
-
-name: 'Build: Windows (x86_64)'
-
-jobs:
- windows_x86-64:
- name: Windows (x86_64)
- runs-on: windows-latest
- defaults:
- run:
- shell: msys2 {0}
- steps:
- - name: "MINGW64: Install, setup, and switch to"
- uses: msys2/setup-msys2@v2
- with:
- update: true
- install: >-
- git
- base-devel
- mingw-w64-x86_64-toolchain
- mingw-w64-x86_64-pkg-config
- mingw-w64-x86_64-openssl
- - name: Setup environment variables
- run: |
- echo "../../_temp/msys/msys64/mingw64/bin" >> $GITHUB_PATH
- LIBRARY_PATH="../../_temp/msys/msys64/mingw64/bin"
- GTK_LIB_DIR="../../_temp/msys/msys64/mingw64/bin" PKG_CONFIG_ALLOW_CROSS=1
- PKG_CONFIG="../../_temp/msys/msys64/mingw64/bin" PKG_CONFIG_ALLOW_CROSS=1
- source ~/.bashrc
- - name: Checkout codebase
- uses: actions/checkout@v3
- - name: Setup Rust toolchain
- uses: actions-rs/toolchain@v1
- with:
- toolchain: nightly-gnu
- target: x86_64-pc-windows-gnu
- default: true
- profile: minimal
- - name: Build depi
- uses: actions-rs/cargo@v1
- with:
- command: build
- args: --release --target x86_64-pc-windows-gnu
- - name: Prepare depi for upload
- run: |
- cd ./target/x86_64-pc-windows-gnu/release/
- tar -czvf x86_64-depi.win32.zip \
- depi.exe \
- depi.dll \
- libdepi.a \
- libdepi.dll.a
- - name: Upload depi build artifacts to GitHub
- uses: actions/upload-artifact@v3
- with:
- name: x86_64-depi.win32
- path: ./target/x86_64-pc-windows-gnu/release/x86_64-depi.win32.zip
- if-no-files-found: error
\ No newline at end of file
diff --git a/.github/workflows/x86_64.yml b/.github/workflows/x86_64.yml
deleted file mode 100644
index f20a4ae..0000000
--- a/.github/workflows/x86_64.yml
+++ /dev/null
@@ -1,48 +0,0 @@
-on:
- push:
- branches:
- - 'master'
-
-name: 'Build: GNU + Linux (x86_64)'
-
-jobs:
- linux_x86-64:
- name: GNU + Linux (x86_64)
- runs-on: ubuntu-latest
- steps:
- - name: Checkout codebase
- uses: actions/checkout@v3
- - name: Install development dependencies
- run: |
- sudo apt-get update > /dev/null
- sudo apt-get install -qq libssl-dev build-essential > /dev/null
- - name: Setup Rust toolchain
- uses: actions-rs/toolchain@v1
- with:
- toolchain: nightly
- target: x86_64-unknown-linux-gnu
- default: true
- profile: minimal
- - name: Build depi
- uses: actions-rs/cargo@v1
- with:
- use-cross: true
- command: build
- args: --release --target x86_64-unknown-linux-gnu
- - name: Prepare depi for upload
- run: |
- cd ./target/x86_64-unknown-linux-gnu/release/
- strip -v --strip-all ./depi
- strip -v --strip-all ./libdepi.so
- strip -v --strip-all ./libdepi.a
- chmod +x ./depi
- tar -cvf x86_64-depi.gnu+linux.tar \
- depi \
- libdepi.so \
- libdepi.a
- - name: Upload depi build artifacts to GitHub
- uses: actions/upload-artifact@v3
- with:
- name: x86_64-depi.gnu+linux
- path: ./target/x86_64-unknown-linux-gnu/release/x86_64-depi.gnu+linux.tar
- if-no-files-found: error
\ No newline at end of file
diff --git a/Cargo.toml b/Cargo.toml
index 46ff14e..32630d0 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -1,17 +1,3 @@
-# This file is part of depi.
-#
-# depi is free software: you can redistribute it and/or modify
-# it under the terms of the GNU Affero General Public License as published by
-# the Free Software Foundation, either version 3 of the License, or
-# (at your option) any later version.
-#
-# depi is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU Affero General Public License for more details.
-#
-# You should have received a copy of the GNU Affero General Public License
-# along with depi. If not, see .
[package]
name = "depi"
version = "0.2.0"
@@ -22,7 +8,7 @@ license = "AGPL-3.0-or-later"
description = "Command-line tool for viewing images."
repository = "https://github.com/Dirout/depi"
homepage = "https://github.com/Dirout/depi"
-readme = "README"
+readme = "README.md"
include = [
"**/*.rs",
"Cargo.toml",
@@ -70,21 +56,6 @@ tokio-stream = "0.1.15"
viuer = "0.6.2"
wild = "2.2.1"
-[profile.release]
-codegen-units = 1
-opt-level = 3
-debug = false
-debug-assertions = false
-overflow-checks = false
-lto = true
-incremental = false
-rpath = false
-strip = true
-
-[profile.release.build-override]
-opt-level = 3
-codegen-units = 1
-
[features]
sixel = ["viuer/sixel"]
avif = ["image/avif-encoder", "image/avif-decoder"]
@@ -95,7 +66,7 @@ priority = "optional"
assets = [
["target/x86_64-unknown-linux-gnu/release/depi", "usr/bin/", "755"],
["target/x86_64-unknown-linux-gnu/release/libdepi.so", "usr/lib/", "644"],
- ["README", "usr/share/doc/depi/README", "644"],
+ ["README.md", "usr/share/doc/depi/README.md", "644"],
["COPYING", "usr/share/doc/depi/COPYING", "644"],
]
@@ -104,6 +75,6 @@ assets = [
{ source = "target/release/depi", dest = "/usr/bin/depi", mode = "755" },
{ source = "target/release/libdepi.so", dest = "/usr/lib/libdepi.so", mode = "755" },
{ source = "target/release/libdepi.a", dest = "/usr/lib/libdepi.a", mode = "755" },
- { source = "README", dest = "/usr/share/doc/ticky/README", mode = "644" },
- { source = "COPYING", dest = "/usr/share/doc/ticky/COPYING", mode = "644" },
+ { source = "README.md", dest = "/usr/share/doc/depi/README.md", mode = "644" },
+ { source = "COPYING", dest = "/usr/share/doc/depi/COPYING", mode = "644" },
]
diff --git a/NOTICE b/NOTICE
index 087e6f5..99fd3e5 100644
--- a/NOTICE
+++ b/NOTICE
@@ -1,5 +1,5 @@
depi is an archive tool for efficient decompression.
- Copyright (C) 2022-2023 Emil Sayahi
+ Copyright (C) Emil Sayahi
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published by
diff --git a/README b/README
deleted file mode 100644
index 0c7c3e0..0000000
--- a/README
+++ /dev/null
@@ -1,5 +0,0 @@
-# depi
-
-depi is a command-line tool for viewing images.
-
-LICENSE: AGPL-3.0-or-later
\ No newline at end of file
diff --git a/README.md b/README.md
new file mode 100644
index 0000000..9dfc20e
--- /dev/null
+++ b/README.md
@@ -0,0 +1,15 @@
+# depi
+
+depi is a command-line tool for viewing images.
+
+You can view images from disk or from the Internet, and you can perform a variety of image transformations when viewing as well.
+
+When compiling, you may optionally enable Sixel support or support for AVIF images.
+
+## Installation
+
+```sh
+cargo install --git https://github.com/Dirout/depi
+```
+
+LICENSE: AGPL-3.0-or-later
\ No newline at end of file
diff --git a/rust-depi.spec b/rust-depi.spec
index 3cfdf43..4a3dd2a 100644
--- a/rust-depi.spec
+++ b/rust-depi.spec
@@ -30,7 +30,7 @@ Summary: %{summary}
%license NOTICE
%doc CODE_OF_CONDUCT.md
%doc CONTRIBUTING.md
-%doc README
+%doc README.md
%doc SECURITY.md
%{_bindir}/depi
@@ -49,7 +49,7 @@ use the "%{crate}" crate.
%license %{crate_instdir}/NOTICE
%doc %{crate_instdir}/CODE_OF_CONDUCT.md
%doc %{crate_instdir}/CONTRIBUTING.md
-%doc %{crate_instdir}/README
+%doc %{crate_instdir}/README.md
%doc %{crate_instdir}/SECURITY.md
%{crate_instdir}/
diff --git a/rust-toolchain.toml b/rust-toolchain.toml
index 0525d35..6679663 100644
--- a/rust-toolchain.toml
+++ b/rust-toolchain.toml
@@ -1,17 +1,3 @@
-# This file is part of depi.
-#
-# depi is free software: you can redistribute it and/or modify
-# it under the terms of the GNU Affero General Public License as published by
-# the Free Software Foundation, either version 3 of the License, or
-# (at your option) any later version.
-#
-# depi is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU Affero General Public License for more details.
-#
-# You should have received a copy of the GNU Affero General Public License
-# along with depi. If not, see .
[toolchain]
channel = "nightly"
targets = [ "aarch64-unknown-linux-gnu", "x86_64-unknown-linux-gnu", "aarch64-apple-darwin", "x86_64-apple-darwin", "x86_64-pc-windows-gnu" ]
\ No newline at end of file
diff --git a/src/lib.rs b/src/lib.rs
index 87d6e7c..af76c55 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -1,17 +1,3 @@
-/*
- This file is part of depi.
- depi is free software: you can redistribute it and/or modify
- it under the terms of the GNU Affero General Public License as published by
- the Free Software Foundation, either version 3 of the License, or
- (at your option) any later version.
- depi is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU Affero General Public License for more details.
- You should have received a copy of the GNU Affero General Public License
- along with depi. If not, see .
-*/
-
#![cfg_attr(feature = "dox", feature(doc_cfg))]
#![allow(clippy::needless_doctest_main)]
diff --git a/src/main.rs b/src/main.rs
index 8a55638..73480d2 100644
--- a/src/main.rs
+++ b/src/main.rs
@@ -1,17 +1,3 @@
-/*
- This file is part of depi.
- depi is free software: you can redistribute it and/or modify
- it under the terms of the GNU Affero General Public License as published by
- the Free Software Foundation, either version 3 of the License, or
- (at your option) any later version.
- depi is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU Affero General Public License for more details.
- You should have received a copy of the GNU Affero General Public License
- along with depi. If not, see .
-*/
-
#![allow(clippy::needless_doctest_main)]
#![doc(
html_logo_url = "https://github.com/Dirout/Dirout.github.io/raw/master/branding/vector/logo.svg",
@@ -86,7 +72,7 @@ async fn main() {
println!(
"
- depi Copyright (C) 2022-2023 Emil Sayahi
+ depi Copyright (C) Emil Sayahi
This program comes with ABSOLUTELY NO WARRANTY; for details type `depi show -w'.
This is free software, and you are welcome to redistribute it
under certain conditions; type `depi show -c' for details.