Skip to content

Convert And Upload #868

Convert And Upload

Convert And Upload #868

Workflow file for this run

# This is a basic workflow to help you get started with Actions
name: Convert And Upload
# Controls when the workflow will run
on:
schedule:
#- cron: "0 14-21 * * *"
#- cron: "0 */1 * * *"
- cron: "*/30 * * * *"
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
inputs:
manual-trigger:
description: 'Manually trigger the workflow'
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
# This workflow contains a single job called "build"
convert:
# The type of runner that the job will run on
runs-on: ubuntu-latest
# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- name: Checkout repository
uses: actions/checkout@v3
- name: Build ConsoleM3U8
run: dotnet build ./ConsoleM3U8/ConsoleM3U8.csproj --configuration Release
- name: Publish ConsoleM3U8
run: dotnet publish ./ConsoleM3U8/ConsoleM3U8.csproj -r linux-x64 --configuration Release --self-contained --output ${{ github.workspace }}/publish
- name: Free Disk Space (Ubuntu)
uses: jlumbroso/free-disk-space@main
with:
# this might remove tools that are actually needed,
# if set to "true" but frees about 6 GB
tool-cache: true
# all of these default to true, but feel free to set to
# "false" if necessary for your workflow
android: true
dotnet: true
haskell: true
large-packages: true
docker-images: true
swap-storage: true
- name: Setup FFmpeg
uses: AnimMouse/setup-ffmpeg@v1
with:
token: ${{ secrets.GH_PAT }}
# Setup rclone
- name: Set up rclone
uses: AnimMouse/setup-rclone@v1
with:
rclone_config: ${{ secrets.RCLONE_CONFIG }}
token: ${{ secrets.GH_PAT }}
# Update rclone config
- name: Update Rclone config
uses: AnimMouse/setup-rclone/update-config@v1
with:
rclone_config_secret_name: RCLONE_CONFIG
token: ${{ secrets.GH_PAT }}
- name: Mount Drive
env:
MASk: ${{secrets.MASK}}
RCLONE_DRIVE_NAME: ${{secrets.RCLONE_DRIVE_NAME}}
MOUNT_PATH: ${{ github.workspace }}/drive_${{secrets.RCLONE_DRIVE_NAME}}
run: |
mkdir -p ${{env.MOUNT_PATH}}
mkdir -p ${{ github.workspace }}/M3U8
rclone mount ${{env.RCLONE_DRIVE_NAME}}:/ ${{env.MOUNT_PATH}} --daemon
rclone copy ${{secrets.RCLONE_M3U8_DRIVE_NAME}}:/${{secrets.RESULT_RCLONE_FOLDER_PATH}} ${{ github.workspace }}/M3U8
# - name: Convert
# id: convert
# run: |
# ${{ github.workspace }}/publish/ConsoleM3U8 --remote-convert-folder "${{ github.workspace }}/drive_${{secrets.RCLONE_DRIVE_NAME}}/${{secrets.WAIT_CONVERT_RCLONE_FOLDER_PATH}}" --remote-result-folder "${{ github.workspace }}/drive_${{ secrets.RCLONE_DRIVE_NAME }}/${{secrets.RESULT_RCLONE_FOLDER_PATH}}" --file-compare-type 3 --local-folder "${{ github.workspace }}" --keyUrl "${{ secrets.ENCRYPTION_KEY_URL }}" --ivUrl "${{ secrets.ENCRYPTION_IV_URL }}" -u ${{ secrets.UPLOAD_URL }} -t "${{ secrets.UPLOAD_TOKEN }}" -o ${{secrets.ORIGINAL_URL}} -r ${{secrets.REPLACE_URL}}
- name: Convert
id: convert
run: |
${{ github.workspace }}/publish/ConsoleM3U8 --redis "${{secrets.REDIS}}" --remote-convert-folder "${{ github.workspace }}/drive_${{secrets.RCLONE_DRIVE_NAME}}/${{secrets.WAIT_CONVERT_RCLONE_FOLDER_PATH}}" --remote-result-folder "${{ github.workspace }}/M3U8" --file-compare-type 3 --local-folder "${{ github.workspace }}" --keyUrl "${{ secrets.ENCRYPTION_KEY_URL }}" --ivUrl "${{ secrets.ENCRYPTION_IV_URL }}" -u ${{ secrets.UPLOAD_URL }} -t "${{ secrets.UPLOAD_TOKEN }}" -o ${{secrets.ORIGINAL_URL}} -r ${{secrets.REPLACE_URL}}
- name: Upload M3U8
run: |
rclone copy "${{steps.convert.outputs.RESULT_PATH}}" ${{secrets.RCLONE_M3U8_DRIVE_NAME}}:/${{secrets.RESULT_RCLONE_FOLDER_PATH}}/