Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[FEATURE] Split out MakeMKV Version into Seperate File #390

Open
wants to merge 15 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
43 changes: 43 additions & 0 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
# Title (remove section)
_Add either feature or bugfix to the title inline with the software version increment_
New Feature - [FEATURE]
Patch or Bugfix - [BUGFIX]

# Description
Please include a summary of the change and which issue is fixed. Please also include relevant motivation and context.
List any dependencies that are required for this change.

Fixes # (issue title here)

## Type of change
Please delete options that are not relevant.

- [ ] Bug fix (non-breaking change which fixes an issue)
- [ ] New feature (non-breaking change which adds functionality)
- [ ] Breaking change (fix or feature that would cause existing functionality to not work as expected)
- [ ] This change requires a documentation update

# How Has This Been Tested?
Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce.
Please also list any relevant details for your test configuration

- [ ] Docker
- [ ] Other (Please state here)

# Checklist:

- [ ] My code follows the style guidelines of this project
- [ ] I have performed a self-review of my own code
- [ ] I have commented on my code, particularly in hard-to-understand areas
- [ ] I have made corresponding changes to the documentation
- [ ] My changes generate no new warnings
- [ ] I have tested that my fix is effective or that my feature works

# Changelog:

Include the details of changes made here
- Change 1
- Change 2

# Logs
Attach logs from successful test runs here
10 changes: 4 additions & 6 deletions .github/workflows/Bump Version.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,10 @@
name: "Version Increment"

on:
push:
# run whenever pushes or merges are done to a non-default branch
branches:
- '*'
- '!main'
workflow_dispatch:
pull_request:
branches:
- main # Only run when a PR is raised against main
workflow_dispatch: # Allows manual triggering

jobs:
version:
Expand Down
111 changes: 111 additions & 0 deletions .github/workflows/MakeMKV-Version.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,111 @@
#
# Automatic-Ripping-Machine
# GitHub Workflow
# Daily checks the MakeMKV version and compares against current MakeMKV Version
# Raise a PR when a new version is found with MakeMKV Version info in the PR
#

name: Check MakeMKV Version

on:
schedule:
- cron: '0 0 * * *' # Runs daily at midnight UTC
workflow_dispatch: # Allows manual triggering

permissions:
contents: write
pull-requests: write

jobs:
check-and-update:
runs-on: ubuntu-latest
if: github.ref == 'refs/heads/main'
steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Get latest MakeMKV version
run: |
echo "Finding current MakeMKV version"
MAKEMKV_VERSION=$(curl -s https://www.makemkv.com/download/ | grep -o "[0-9.]*.txt" | sed 's/.txt//')
echo "Latest version found: $MAKEMKV_VERSION"
echo "MAKEMKV_VERSION=$MAKEMKV_VERSION" >> $GITHUB_ENV

- name: Check current version
id: check_version
run: |
if [[ -f VERSION_MAKEMKV ]]; then
CURRENT_VERSION=$(cat VERSION_MAKEMKV)
else
echo -e "\033[0;31mERROR:\033[0m VERSION_MAKEMKV file not found. Assuming new version required."
CURRENT_VERSION="0.0.0"
fi

if [[ "$CURRENT_VERSION" == "$MAKEMKV_VERSION" ]]; then
echo "No new version found."
echo -e "Current version: \033[0;32m$CURRENT_VERSION\033[0m"
echo "skip=true" >> $GITHUB_ENV
else
echo "New version available."
echo -e "ARM version: \033[0;34m$CURRENT_VERSION\033[0m"
echo -e "Latest MakeMKV version: \033[0;32m$MAKEMKV_VERSION\033[0m"
echo "skip=false" >> $GITHUB_ENV
fi

echo "CURRENT_VERSION=$CURRENT_VERSION" >> $GITHUB_ENV

- name: Fetch MakeMKV version history
if: env.skip == 'false'
run: |
HISTORY=curl -s https://www.makemkv.com/download/history.html \
| sed -n -e "/MakeMKV v${MAKEMKV_VERSION}/,/MakeMKV v/ p" \
| sed -e '$d' \
| sed 's/<[^>]*>//g'
echo "Version History:"
echo "$HISTORY"
echo "$HISTORY" > makemkv_history.txt
echo "VERSION_HISTORY<<EOF" >> $GITHUB_ENV
echo "$HISTORY" >> $GITHUB_ENV
echo "EOF" >> $GITHUB_ENV

- name: Update VERSION_MAKEMKV file
if: env.skip == 'false'
run: |
if git ls-remote --exit-code --heads origin "update-makemkv-${MAKEMKV_VERSION}"; then
echo "Branch update-makemkv-${MAKEMKV_VERSION} already exists. Cancelling Job."
echo "branch_exists=true" >> $GITHUB_ENV
exit 0
fi
echo "$MAKEMKV_VERSION" > VERSION_MAKEMKV
git config --global user.name "github-actions[bot]"
git config --global user.email "github-actions[bot]@users.noreply.github.com"
git checkout -b update-makemkv-$MAKEMKV_VERSION
git add VERSION_MAKEMKV
git commit -m "Update MakeMKV version to $MAKEMKV_VERSION"
git push origin "update-makemkv-${MAKEMKV_VERSION}"

- name: Create Pull Request
if: env.skip == 'false' && env.branch_exists != 'true'
uses: peter-evans/create-pull-request@v7
with:
branch: update-makemkv-${{ env.MAKEMKV_VERSION }}
title: "[FEATURE] Update MakeMKV to ${{ env.MAKEMKV_VERSION }} from ${{ env.CURRENT_VERSION }}"
base: main
labels: MakeMKV
body: |
## MakeMKV Update
A new version of MakeMKV has been released
Old Version: ${{ env.CURRENT_VERSION }}
New Version: ${{ env.MAKEMKV_VERSION }}

This PR updates `VERSION_MAKEMKV` to reflect the latest release.

### Version History:
```
${{ env.VERSION_HISTORY }}
```

PR automatically created by GitHub Workflow.
Do not make any commits against branch `update-makemkv-${{ env.MAKEMKV_VERSION }}`.

Commits made against this branch will cause the script to fail.
26 changes: 26 additions & 0 deletions .github/workflows/Release-PR.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: Create or Update Staging PR

on:
push:
branches:
- staging
workflow_dispatch:

jobs:
release_pr:
runs-on: ubuntu-latest

steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Create Release PR
uses: peter-evans/create-pull-request@v6
with:
branch: release
base: main
title: "[Release]: ARM-Dependencies new release"
body: "This PR batches all merged changes into a single release."
labels: release
draft: false
delete-branch: true
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1.2.3
1.3.0
1 change: 1 addition & 0 deletions VERSION_MAKEMKV
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
1.17.8
23 changes: 20 additions & 3 deletions scripts/install_makemkv.sh
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,27 @@
# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
# DEALINGS IN THE SOFTWARE.

## ARM Modification of base script
# Define colors
RED="\033[0;31m"
GREEN="\033[0;32m"
NC="\033[0m"

# Auto-grab latest version
echo -e "${RED}Finding current MakeMKV version${NC}"
MAKEMKV_VERSION=$(curl -s https://www.makemkv.com/download/ | grep -o "[0-9.]*.txt" | sed 's/.txt//')
echo -e "${RED}Downloading MakeMKV $MAKEMKV_VERSION sha, bin, and oss${NC}"
echo -e "${GREEN}Finding current MakeMKV version${NC}"

# Check if VERSION_MAKEMKV file exists at root
if [[ -f "$(git rev-parse --show-toplevel)/VERSION_MAKEMKV" ]]; then
MAKEMKV_VERSION=$(cat "$(git rev-parse --show-toplevel)/VERSION_MAKEMKV")
echo -e "Using MakeMKV version from VERSION_MAKEMKV: ${GREEN}$MAKEMKV_VERSION${NC}"
else
echo -e "${RED}ERROR:${NC} VERSION_MAKEMKV file not found. Fetching latest version."
MAKEMKV_VERSION=$(curl -s https://www.makemkv.com/download/ | grep -o "[0-9.]*.txt" | sed 's/.txt//')
echo -e "Using MakeMKV version direct from MakeMKV: ${GREEN}$MAKEMKV_VERSION${NC}"
fi

echo -e "${GREEN}Downloading MakeMKV $MAKEMKV_VERSION sha, bin, and oss${NC}"
## Finish ARM Modification

set -ex
savedAptMark="$(apt-mark showmanual)"
Expand Down
Loading