Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
Markkop authored Aug 5, 2023
1 parent ded2149 commit 44348bf
Showing 1 changed file with 23 additions and 14 deletions.
37 changes: 23 additions & 14 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
# <img alt="Demo PrintsCreen" src="public/256x256.png" width="26"> Youtube - Download and Cut

![Repo status](https://www.repostatus.org/badges/latest/inactive.svg)
[![Build Status](https://travis-ci.com/Markkop/yt-dlandcut.svg?branch=master)](https://travis-ci.com/Markkop/yt-dlandcut)
![contributions welcome](https://img.shields.io/badge/contributions-welcome-brightgreen.svg?style=flat)
![https://img.shields.io/badge/repo%20status-maintenance-yellow](https://img.shields.io/badge/repo%20status-maintenance-yellow)
![GitHub release (latest by date)](https://img.shields.io/github/v/release/markkop/yt-dlandcut)

<kbd>
Expand All @@ -11,14 +9,18 @@

## About

This app **downloads** youtube videos and **cuts** them with [ffmpeg](https://www.ffmpeg.org/) given starting and ending times.
This is one of my first side projects as a developer from a few years ago.
The goal was to make it easy for people to download and cut Youtube videos so they could share them.
**Since it depends on libraries that get videos from YouTube, this software may stop working at any time.**
If that happens, let me know so I can look and see if I can fix it.

## Usage

Download the [latest release](https://github.com/Markkop/yt-dlandcut/releases/latest) for Linux (**.appImage**), Windows (**.exe**) or MacOS (**.dmg**) at the [releases](https://github.com/Markkop/yt-dlandcut/releases/) page.
The first time you run this app (or if required `binaries` are not found), the app will download ffmpeg files according to your OS.
After finishing, a folder inside your home folder named `yt-dlandcut` will contain the files.
If you run into any problem, please [let me know](https://twitter.com/heymarkkop).
* Download the [latest release](https://github.com/Markkop/yt-dlandcut/releases/latest) for Linux (**.appImage**), Windows (**.exe**) or MacOS (**.dmg**) at the [releases](https://github.com/Markkop/yt-dlandcut/releases/) page.
* You might need to manually bypass security warnings that might appear from your OS (the app is safe, check the code it want to make sure)
* The first time you run this app, it will download the `ffmpeg` file according to your OS.
* Once completed, you will find a folder called `yt-dlandcut` within your home folder containing the downloaded and converted files.
If you have any problem, please [let me know](https://twitter.com/heymarkkop).

## Options

Expand All @@ -33,7 +35,7 @@ If you run into any problem, please [let me know](https://twitter.com/heymarkkop

Make sure to have `node` and `yarn` installed.
Run `yarn` to install dependencies and `yarn start` to transpile and run the code.
By running `yarn build`, electron-builder will build a package inside `dist` folder according to your current operational system and following `build` options on `package.json`
To create a package based on your current operating system and build options in `package.json`, simply run `yarn build`. The resulting package will be located in the `dist` folder.

## Deploy/Release

Expand All @@ -43,12 +45,19 @@ The first option to build and release this project's binaries is by running the
Electron Builder will know that it should also deploy after building because of this script command name `release` and it will look for a `GH_TOKEN` environment variable to publish to GitHub as a draft release with the package version.
You can set this environment variable by adding `export GH_TOKEN=CHANGE_THIS` to `~/.zshrc` or `~/.bashrc` file and sourcing it with `source ~./zshrc` after [creating a token](https://github.com/settings/tokens/new).

However, the [recommend way](https://www.electron.build/configuration/publish#recommended-github-releases-workflow) is by using a Continuous Integration service, [TravisCI](https://travis-ci.com/) in this case.
First, a collaborator have to [draft a new release](https://help.github.com/articles/creating-releases/) with the `package.json` version. Then, after every push, TravisCI will run `yarn build`, building the files and providing them as assets in the drafted Github's release.
However, the [recommend way](https://www.electron.build/configuration/publish#recommended-github-releases-workflow) is by using a Continuous Integration service, Github Actions in this case.
First, a collaborator have to [draft a new release](https://help.github.com/articles/creating-releases/) with the `package.json` version. Then, after every push, GH Actions will run `yarn build`, building the files and providing them as assets in the drafted Github's release.

For this to happen, it's required to have `"build": { "publish": "github" }` in `package.json` and `GH_TOKEN` as environment variable inside TravisCI dashboard's build settings.
Then after a passing build, a collaborator can simply publish it.
The current `.travis.yml` is similar to this [sample](https://www.electron.build/multi-platform-build#sample-travisyml-to-build-electron-app-for-macos-linux-and-windows).

It's also possible to deploy using [provider: releases](https://docs.travis-ci.com/user/deployment/releases/) TravisCI deploy configuration.
Here are some examples: [this](https://github.com/lane-c-wagner/electron-ci-boilerplate/blob/master/.travis.yml) and [this](https://github.com/gontarczyk-artur/electron-travis-poc/blob/master/.travis.yml).
It's also possible to deploy using [provider: releases](https://docs.travis-ci.com/user/deployment/releases/) deploy configuration.
Here are some examples for Travis: [this](https://github.com/lane-c-wagner/electron-ci-boilerplate/blob/master/.travis.yml) and [this](https://github.com/gontarczyk-artur/electron-travis-poc/blob/master/.travis.yml).

Note: I used to used TravisCI, but ended up converting the yml to Github Action using ChatGPT.

### TL;DR:

- Create a draft release on GitHub
- Run the `yarn release` command and ensure that the GH_TOKEN environment variable is exported to the current shell.
- Or you can have Github Action deploy it automatically when you push a commit.

0 comments on commit 44348bf

Please sign in to comment.