You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
lossless-cut/CONTRIBUTING.md

181 lines
5.3 KiB
Markdown

# Contributing
6 months ago
## [Translations](docs/translation.md)
1 year ago
## Development environment setup
6 years ago
This app is built using Electron.
Make sure you have at least Node v16. The app uses ffmpeg from PATH when developing.
```bash
6 years ago
git clone https://github.com/mifi/lossless-cut.git
cd lossless-cut
6 years ago
yarn
6 years ago
```
Note: `yarn` may take some time to complete.
6 years ago
### Installing `ffmpeg`
Run one of the below commands:
```bash
2 years ago
yarn download-ffmpeg-darwin-x64
yarn download-ffmpeg-darwin-arm64
yarn download-ffmpeg-linux-x64
yarn download-ffmpeg-win32-x64
```
6 years ago
For Windows, you may have to install [7z](https://www.7-zip.org/download.html), and then put the 7z folder in your `PATH`.
3 years ago
### Running
```bash
2 years ago
yarn dev
6 years ago
```
## `mas-dev` (Mac App Store) local build
This will sign using the development provisioning profile:
```bash
2 years ago
yarn pack-mas-dev
```
MAS builds have some restrictions, see `isMasBuild` variable in code. In particular, any file cannot be read without the user's consent.
NOTE: when MAS (dev) build, Application Support will instead be located here:
```
~/Library/Containers/no.mifi.losslesscut-mac/Data/Library/Application Support
```
### Starting over fresh
```bash
rm -rf ~/Library/Containers/no.mifi.losslesscut-mac
```
3 years ago
## Windows Store notes
Windows store version is built as a Desktop Bridge app (with `runFullTrust` capability). This means the app has access to essentially everything the user has access to, and even `internetClient` is redundant.
- https://learn.microsoft.com/en-us/windows/uwp/packaging/app-capability-declarations
- https://learn.microsoft.com/en-us/archive/blogs/appconsult/a-simpler-and-faster-way-to-publish-your-desktop-bridge-applications-on-the-microsoft-store
- https://stackoverflow.com/a/52921641/6519037
## Releasing
8 years ago
Before releasing, consider [Maintainence chores](#maintainence-chores) first.
8 months ago
### Prepare and build new version
- `git checkout master`
- `git merge stores` (in case there's an old unmerged stores hotfix)
8 months ago
- **Prepare release notes** from commit history
- Create a new file `versions/x.y.z.md` and write the most important highlights from the release notes, but **remove github issue #references**
6 months ago
- `node script/generateVersions.ts && git add versions/*.md src/renderer/src/versions.json && git commit -m 'Update change log'`
- *If Store-only hotfix release*
- `git checkout stores`
- `npm version patch`
- *If normal GitHub-first release*
- `npm version minor && git --no-pager show`
3 years ago
- `git push --follow-tags`
- Wait for build and draft in Github actions
### Release built version
8 months ago
- Open draft in github and add the prepared release notes
- Add suffix `-DONT-USE-THIS-FILE` to `LosslessCut-mac-universal.pkg` and `LosslessCut-win-x64.appx`
- *If GitHub release*
- Release the draft
- *If Store-only hotfix release*
- Remove all other artifacts and release the draft as **pre-release**
3 years ago
8 months ago
#### After releasing in GitHub
3 years ago
- *If Stores-only hotfix release*
- `git checkout master`
- `git merge stores`
- Bump [snap version](https://snapcraft.io/losslesscut/releases)
### After releasing existing GitHub version in Stores
- `git checkout stores`
- Find the tag just released in the Stores
- Merge this tag (from `master`) into `stores`: `git merge vX.Y.Z`
- `git push`
- `git checkout master`
### More info
For per-platform build/signing setup, see [this article](https://mifi.no/blog/automated-electron-build-with-release-to-mac-app-store-microsoft-store-snapcraft/).
2 years ago
## Weblate
`yarn scan-i18n` to get the newest English strings and push so Weblate gets them.
Find the [latest PR](https://github.com/mifi/lossless-cut/pulls) from Weblate and **rebase+merge** it.
6 months ago
**Warning:** Do not squash and merge (see [here why](docs/translation.md#weblate))!
5 years ago
## Minimum OS version
6 months ago
See [requirements](docs/requirements.md).
### MacOS [`LSMinimumSystemVersion`](https://developer.apple.com/documentation/bundleresources/information_property_list/lsminimumsystemversion)
How to check the value:
```bash
2 years ago
yarn pack-mas-dev
cat dist/mas-dev-arm64/LosslessCut.app/Contents/Info.plist
```
```xml
<key>LSMinimumSystemVersion</key>
<string>10.13</string>
```
`LSMinimumSystemVersion` can be overridden in `electron-builder` by [`mac.minimumSystemVersion`](https://www.electron.build/configuration/mac.html)
9 months ago
See also `MACOSX_DEPLOYMENT_TARGET` in [ffmpeg-build-script](https://github.com/mifi/ffmpeg-build-script/blob/master/build-ffmpeg).
Links:
- https://support.google.com/chrome/a/answer/7100626
- https://bignerdranch.com/blog/requiring-a-minimum-version-of-os-x-for-your-application/
- [#1386](https://github.com/mifi/lossless-cut/issues/1386)
5 years ago
## Maintainence chores
5 years ago
5 years ago
### Keep dependencies up to date
9 months ago
- FFmpeg: [ffmpeg-build-script](https://github.com/mifi/ffmpeg-build-script), [ffmpeg-builds](https://github.com/mifi/ffmpeg-builds) and [package.json](./package.json) download scripts.
- `electron` and upgrade [electron.vite.config.ts](./electron.vite.config.ts) `target`s.
- `@electron/remote`
- `package.json` / `yarn.lock`
5 years ago
### i18n
```bash
yarn scan-i18n
```
5 years ago
### Regenerate licenses file
5 years ago
```bash
2 years ago
yarn generate-licenses
4 years ago
#cp licenses.txt losslesscut.mifi.no/public/
5 years ago
```
5 years ago
Then deploy.
### Dependabot
https://github.com/mifi/lossless-cut/security/dependabot
## FFmpeg builds
- https://github.com/BtbN/FFmpeg-Builds
- https://www.gyan.dev/ffmpeg/builds/
- https://github.com/m-ab-s/media-autobuild_suite
## Other
- Update `copyrightYear`