-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Closes #40
- Loading branch information
Showing
4 changed files
with
92 additions
and
83 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -87,16 +87,16 @@ Rust and some listed Crates inside of [Cargo.toml](Cargo.toml) under _dependenci | |
- [Rust 2021](https://www.rust-lang.org/tools/install) | ||
- [yt-dlp](https://github.com/yt-dlp/yt-dlp/wiki/Installation) | ||
- [ffmpeg](https://ffmpeg.org/download.html) | ||
- If you are on Windows and want to have the `make` command: [Windows Subsystem for Linux with Ubuntu](https://www.microsoft.com/de-de/p/ubuntu-2004-lts/9n6svws3rx71?activetab=pivot:overviewtab) | ||
- [task](https://taskfile.dev/#/installation) | ||
|
||
### Setting up Dev | ||
|
||
Once you are done with installing the prerequisites, you should run `make` to see if everything runs smooth: | ||
Once you are done with installing the prerequisites, you should run `task` to see if everything runs smooth: | ||
|
||
```shell | ||
git clone [email protected]:TGotwig/vidmerger.git | ||
cd vidmerger | ||
make | ||
task | ||
``` | ||
|
||
Also click on _fork_ from the top right corner of this repository and run: | ||
|
@@ -109,7 +109,7 @@ git remote add <your-github-name> [email protected]:<your-github-name>/vidmerger.gi | |
|
||
### Building | ||
|
||
Run `make build` to build for Mac, Linux and Windows. You can find the compressed Mac & Linux .tar.gz-archives for Github under _target/tars_, the .exe file for Windows under _tools_. | ||
Run `task build` to build for Mac, Linux and Windows. You can find the compressed Mac & Linux .tar.gz-archives for Github under _target/tars_, the .exe file for Windows under _tools_. | ||
|
||
### Deploying / Publishing | ||
|
||
|
@@ -120,18 +120,18 @@ Run `make build` to build for Mac, Linux and Windows. You can find the compresse | |
|
||
#### Manual steps | ||
|
||
Increasing all versions by _find and replace_, then after `make build`: | ||
Increasing all versions by _find and replace_, then after `task build`: | ||
|
||
- Dockerhub: Run `make publish_dockerhub`. | ||
- Dockerhub: Run `task publish_dockerhub`. | ||
|
||
## 📦 Versioning | ||
|
||
We use [SemVer](http://semver.org/) for versioning. | ||
|
||
## 🧪 Tests | ||
|
||
- For major tests: `make test` (requires `yt-dlp` and `ffmpeg` to be installed) | ||
- For linting tests: `make lint` | ||
- For major tests: `task test` (requires `yt-dlp` and `ffmpeg` to be installed) | ||
- For linting tests: `task lint` | ||
|
||
## 🌟 Style guide | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,79 @@ | ||
version: '3' | ||
|
||
tasks: | ||
default: | ||
deps: [install, test] | ||
|
||
install: | ||
cmds: | ||
- cargo install cross | ||
- rustup component add clippy | ||
|
||
run: | ||
cmds: | ||
- cargo run -- data | ||
|
||
# TODO - fix this | ||
run_docker: | ||
deps: [build_linux_x64] | ||
cmds: | ||
- docker build -t vidmerger . | ||
- docker container run -it --rm -v `pwd`/data:/data vidmerger | ||
|
||
test: | ||
cmds: | ||
- cargo test -- --exact --nocapture $(name) | ||
|
||
test_units: | ||
cmds: | ||
- cargo test --bins -- --exact --nocapture $(name) | ||
|
||
lint: | ||
cmds: | ||
- cargo clippy | ||
|
||
# TODO - fix this | ||
build: | ||
deps: [build_linux_x64, build_mac_x64, build_win_x64, shasum] | ||
|
||
# TODO - fix this | ||
build_linux_x64: | ||
cmds: | ||
- echo 'Building for Linux... 🐧' | ||
- cross build --release --target=x86_64-unknown-linux-musl | ||
- mkdir -p target/release-archives && tar -C target/x86_64-unknown-linux-musl/release -czf target/release-archives/vidmerger-linux.tar.gz vidmerger | ||
|
||
# TODO - fix this | ||
build_mac_x64: | ||
cmds: | ||
- echo 'Building for MacOS... 🍏' | ||
- cross build --release --target=x86_64-apple-darwin | ||
- mkdir -p target/release-archives && tar -C target/x86_64-apple-darwin/release -czf target/release-archives/vidmerger-mac.tar.gz vidmerger | ||
|
||
build_win_x64: | ||
cmds: | ||
- echo 'Building for Windows... 🏳️🌈' | ||
- cross build --release --target x86_64-pc-windows-gnu | ||
- cd target/x86_64-pc-windows-gnu/release && mv vidmerger.exe ../../../tools | ||
|
||
shasum: | ||
cmds: | ||
- shasum -a 256 target/release-archives/vidmerger* | ||
- shasum -a 256 tools/vidmerger.exe | ||
|
||
# TODO - test this | ||
publish_choco: | ||
cmds: | ||
- choco pack | ||
- Get-ChildItem *.nupkg | ren -NewName vidmerger.nupkg | ||
- choco push vidmerger.nupkg --source https://push.chocolatey.org | ||
- Remove-Item vidmerger.nupkg | ||
|
||
# TODO - test this, automate versioning | ||
publish_dockerhub: | ||
cmds: | ||
- docker build --no-cache -t vidmerger . | ||
- docker tag vidmerger tgotwig/vidmerger:0.3.1 | ||
- docker push tgotwig/vidmerger:0.3.1 | ||
- docker tag vidmerger tgotwig/vidmerger | ||
- docker push tgotwig/vidmerger |