From ba15a0fd6067023d35dc81d8e7057abb1104a79d Mon Sep 17 00:00:00 2001 From: Aleksandr Statciuk Date: Fri, 26 Nov 2021 22:00:49 +0300 Subject: [PATCH 1/7] Update auto-update.yml --- .github/workflows/auto-update.yml | 53 +++++++++++++++++++++++++++++-- 1 file changed, 51 insertions(+), 2 deletions(-) diff --git a/.github/workflows/auto-update.yml b/.github/workflows/auto-update.yml index a0f16ef740..c8b62b5734 100644 --- a/.github/workflows/auto-update.yml +++ b/.github/workflows/auto-update.yml @@ -4,8 +4,22 @@ on: schedule: - cron: '0 0,12 * * *' jobs: + delete-old-branch: + runs-on: ubuntu-latest + continue-on-error: true + steps: + - name: Checkout + uses: actions/checkout@v2 + with: + ref: ${{ github.ref }} + - name: Delete Branch + uses: dawidd6/action-delete-branch@v3 + with: + github_token: ${{ secrets.GITHUB_TOKEN }} + branches: 'bot/auto-update' create-branch: runs-on: ubuntu-latest + needs: delete-old-branch steps: - name: Checkout uses: actions/checkout@v2 @@ -27,6 +41,11 @@ jobs: uses: actions/checkout@v2 with: ref: bot/auto-update + - name: Setup Node + uses: actions/setup-node@v2 + with: + node-version: '14' + cache: 'npm' - name: Install Dependencies run: npm install - name: Create Matrix @@ -46,10 +65,15 @@ jobs: ref: bot/auto-update - name: Setup FFmpeg uses: FedericoCarboni/setup-ffmpeg@v1 + - name: Setup Node + uses: actions/setup-node@v2 + with: + node-version: '14' + cache: 'npm' - name: Install Dependencies run: npm install - name: Format Playlists - run: node scripts/format.js --country=${{ matrix.country }} --debug + run: node scripts/format.js --country=${{ matrix.country }} --timeout=60000 --debug - name: Upload Artifact uses: actions/upload-artifact@v2 with: @@ -85,6 +109,11 @@ jobs: uses: actions/checkout@v2 with: ref: bot/auto-update + - name: Setup Node + uses: actions/setup-node@v2 + with: + node-version: '14' + cache: 'npm' - name: Install Dependencies run: npm install - name: Remove Duplicates @@ -106,6 +135,11 @@ jobs: uses: actions/checkout@v2 with: ref: bot/auto-update + - name: Setup Node + uses: actions/setup-node@v2 + with: + node-version: '14' + cache: 'npm' - name: Install Dependencies run: npm install - name: Sort Channels @@ -127,6 +161,11 @@ jobs: uses: actions/checkout@v2 with: ref: bot/auto-update + - name: Setup Node + uses: actions/setup-node@v2 + with: + node-version: '14' + cache: 'npm' - name: Install Dependencies run: npm install - name: Filter Playlists @@ -148,6 +187,11 @@ jobs: uses: actions/checkout@v2 with: ref: bot/auto-update + - name: Setup Node + uses: actions/setup-node@v2 + with: + node-version: '14' + cache: 'npm' - name: Install Dependencies run: npm install - name: Generate Playlists @@ -158,7 +202,6 @@ jobs: name: gh-pages path: .gh-pages/ deploy: - if: ${{ github.ref == 'refs/heads/master' }} runs-on: ubuntu-latest needs: generate steps: @@ -178,6 +221,7 @@ jobs: app_id: ${{ secrets.APP_ID }} private_key: ${{ secrets.APP_PRIVATE_KEY }} - name: Deploy to GitHub Pages + if: ${{ github.ref == 'refs/heads/master' }} uses: JamesIves/github-pages-deploy-action@4.1.1 with: branch: gh-pages @@ -194,6 +238,11 @@ jobs: uses: actions/checkout@v2 with: ref: bot/auto-update + - name: Setup Node + uses: actions/setup-node@v2 + with: + node-version: '14' + cache: 'npm' - name: Install Dependencies run: npm install - name: Update README.md From c8a373d3185c3916205879ea6f95e4827722e933 Mon Sep 17 00:00:00 2001 From: Aleksandr Statciuk Date: Fri, 26 Nov 2021 22:53:45 +0300 Subject: [PATCH 2/7] Update auto-update.yml --- .github/workflows/auto-update.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/auto-update.yml b/.github/workflows/auto-update.yml index c8b62b5734..d998841ed8 100644 --- a/.github/workflows/auto-update.yml +++ b/.github/workflows/auto-update.yml @@ -73,7 +73,7 @@ jobs: - name: Install Dependencies run: npm install - name: Format Playlists - run: node scripts/format.js --country=${{ matrix.country }} --timeout=60000 --debug + run: node scripts/format.js --country=${{ matrix.country }} --debug - name: Upload Artifact uses: actions/upload-artifact@v2 with: From 3303cd71730a350fd5f0cb790e275fb8714cb89c Mon Sep 17 00:00:00 2001 From: Aleksandr Statciuk Date: Sat, 27 Nov 2021 01:31:02 +0300 Subject: [PATCH 3/7] Update auto-update.yml --- .github/workflows/auto-update.yml | 21 ++++++--------------- 1 file changed, 6 insertions(+), 15 deletions(-) diff --git a/.github/workflows/auto-update.yml b/.github/workflows/auto-update.yml index d998841ed8..4871d8c617 100644 --- a/.github/workflows/auto-update.yml +++ b/.github/workflows/auto-update.yml @@ -4,33 +4,24 @@ on: schedule: - cron: '0 0,12 * * *' jobs: - delete-old-branch: - runs-on: ubuntu-latest - continue-on-error: true - steps: - - name: Checkout - uses: actions/checkout@v2 - with: - ref: ${{ github.ref }} - - name: Delete Branch - uses: dawidd6/action-delete-branch@v3 - with: - github_token: ${{ secrets.GITHUB_TOKEN }} - branches: 'bot/auto-update' create-branch: runs-on: ubuntu-latest - needs: delete-old-branch steps: - name: Checkout uses: actions/checkout@v2 with: ref: ${{ github.ref }} + - name: Set Branch Name + id: set-branch-name + run: echo "::set-output name=branch_name::bot/auto-update" - name: Create Branch uses: peterjgrainger/action-create-branch@v2.0.1 env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} with: - branch: 'bot/auto-update' + branch: ${{ steps.set-branch-name.outputs.branch_name }} + - name: Exit + run: exit 1 create-matrix: runs-on: ubuntu-latest needs: create-branch From feb575cb35c533818f5b8fccf16d42b10ede2861 Mon Sep 17 00:00:00 2001 From: Aleksandr Statciuk Date: Sat, 27 Nov 2021 01:38:09 +0300 Subject: [PATCH 4/7] Update auto-update.yml --- .github/workflows/auto-update.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/auto-update.yml b/.github/workflows/auto-update.yml index 4871d8c617..7871893a3a 100644 --- a/.github/workflows/auto-update.yml +++ b/.github/workflows/auto-update.yml @@ -13,7 +13,7 @@ jobs: ref: ${{ github.ref }} - name: Set Branch Name id: set-branch-name - run: echo "::set-output name=branch_name::bot/auto-update" + run: echo "::set-output name=branch_name::bot/auto-update-$(date +'%Y%m%d')" - name: Create Branch uses: peterjgrainger/action-create-branch@v2.0.1 env: From 5f0f8a94275ae09e8dc796586eba3d8ecfdeb41d Mon Sep 17 00:00:00 2001 From: Aleksandr Statciuk Date: Sat, 27 Nov 2021 01:47:38 +0300 Subject: [PATCH 5/7] Update auto-update.yml --- .github/workflows/auto-update.yml | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/.github/workflows/auto-update.yml b/.github/workflows/auto-update.yml index 7871893a3a..da4a88006a 100644 --- a/.github/workflows/auto-update.yml +++ b/.github/workflows/auto-update.yml @@ -6,6 +6,8 @@ on: jobs: create-branch: runs-on: ubuntu-latest + outputs: + branch_name: ${{ steps.set-branch-name.outputs.branch_name }} steps: - name: Checkout uses: actions/checkout@v2 @@ -13,21 +15,23 @@ jobs: ref: ${{ github.ref }} - name: Set Branch Name id: set-branch-name - run: echo "::set-output name=branch_name::bot/auto-update-$(date +'%Y%m%d')" + run: echo "::set-output name=branch_name::bot/auto-update-$(date +'%Y%m%d%H%M%S')" - name: Create Branch uses: peterjgrainger/action-create-branch@v2.0.1 env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} with: branch: ${{ steps.set-branch-name.outputs.branch_name }} - - name: Exit - run: exit 1 create-matrix: runs-on: ubuntu-latest needs: create-branch outputs: matrix: ${{ steps.set-matrix.outputs.matrix }} steps: + - name: Display Branch Name + run: echo ${{ needs.create-branch.outputs.branch_name }} + - name: Exit + run: exit 1 - name: Checkout uses: actions/checkout@v2 with: From 6f7f595e15624770128a3ebfb59128b142f0870b Mon Sep 17 00:00:00 2001 From: Aleksandr Statciuk Date: Sat, 27 Nov 2021 02:04:36 +0300 Subject: [PATCH 6/7] Update auto-update.yml --- .github/workflows/auto-update.yml | 58 ++++++++++++++----------------- 1 file changed, 27 insertions(+), 31 deletions(-) diff --git a/.github/workflows/auto-update.yml b/.github/workflows/auto-update.yml index da4a88006a..3c481b4b15 100644 --- a/.github/workflows/auto-update.yml +++ b/.github/workflows/auto-update.yml @@ -15,7 +15,7 @@ jobs: ref: ${{ github.ref }} - name: Set Branch Name id: set-branch-name - run: echo "::set-output name=branch_name::bot/auto-update-$(date +'%Y%m%d%H%M%S')" + run: echo "::set-output name=branch_name::$(date +'bot/auto-update-%Y%m%d%H%M00')" - name: Create Branch uses: peterjgrainger/action-create-branch@v2.0.1 env: @@ -28,14 +28,10 @@ jobs: outputs: matrix: ${{ steps.set-matrix.outputs.matrix }} steps: - - name: Display Branch Name - run: echo ${{ needs.create-branch.outputs.branch_name }} - - name: Exit - run: exit 1 - name: Checkout uses: actions/checkout@v2 with: - ref: bot/auto-update + ref: ${{ needs.create-branch.outputs.branch_name }} - name: Setup Node uses: actions/setup-node@v2 with: @@ -48,7 +44,7 @@ jobs: run: node scripts/create-matrix.js format: runs-on: ubuntu-latest - needs: create-matrix + needs: [create-matrix, create-branch] continue-on-error: true strategy: fail-fast: false @@ -57,7 +53,7 @@ jobs: - name: Checkout uses: actions/checkout@v2 with: - ref: bot/auto-update + ref: ${{ needs.create-branch.outputs.branch_name }} - name: Setup FFmpeg uses: FedericoCarboni/setup-ffmpeg@v1 - name: Setup Node @@ -68,7 +64,7 @@ jobs: - name: Install Dependencies run: npm install - name: Format Playlists - run: node scripts/format.js --country=${{ matrix.country }} --debug + run: node scripts/format.js --country=${{ matrix.country }} --debug --offline - name: Upload Artifact uses: actions/upload-artifact@v2 with: @@ -76,12 +72,12 @@ jobs: path: channels/${{ matrix.country }}.m3u commit-changes: runs-on: ubuntu-latest - needs: format + needs: [format, create-branch] steps: - name: Checkout uses: actions/checkout@v2 with: - ref: bot/auto-update + ref: ${{ needs.create-branch.outputs.branch_name }} - name: Download Artifacts uses: actions/download-artifact@v2 with: @@ -94,16 +90,16 @@ jobs: commit_user_name: iptv-bot commit_user_email: 84861620+iptv-bot[bot]@users.noreply.github.com commit_author: 'iptv-bot[bot] <84861620+iptv-bot[bot]@users.noreply.github.com>' - branch: bot/auto-update + branch: ${{ needs.create-branch.outputs.branch_name }} file_pattern: channels/* remove-duplicates: runs-on: ubuntu-latest - needs: commit-changes + needs: [commit-changes, create-branch] steps: - name: Checkout uses: actions/checkout@v2 with: - ref: bot/auto-update + ref: ${{ needs.create-branch.outputs.branch_name }} - name: Setup Node uses: actions/setup-node@v2 with: @@ -120,16 +116,16 @@ jobs: commit_user_name: iptv-bot commit_user_email: 84861620+iptv-bot[bot]@users.noreply.github.com commit_author: 'iptv-bot[bot] <84861620+iptv-bot[bot]@users.noreply.github.com>' - branch: bot/auto-update + branch: ${{ needs.create-branch.outputs.branch_name }} file_pattern: channels/* sort: runs-on: ubuntu-latest - needs: remove-duplicates + needs: [remove-duplicates, create-branch] steps: - name: Checkout uses: actions/checkout@v2 with: - ref: bot/auto-update + ref: ${{ needs.create-branch.outputs.branch_name }} - name: Setup Node uses: actions/setup-node@v2 with: @@ -146,16 +142,16 @@ jobs: commit_user_name: iptv-bot commit_user_email: 84861620+iptv-bot[bot]@users.noreply.github.com commit_author: 'iptv-bot[bot] <84861620+iptv-bot[bot]@users.noreply.github.com>' - branch: bot/auto-update + branch: ${{ needs.create-branch.outputs.branch_name }} file_pattern: channels/* filter: runs-on: ubuntu-latest - needs: sort + needs: [sort, create-branch] steps: - name: Checkout uses: actions/checkout@v2 with: - ref: bot/auto-update + ref: ${{ needs.create-branch.outputs.branch_name }} - name: Setup Node uses: actions/setup-node@v2 with: @@ -172,16 +168,16 @@ jobs: commit_user_name: iptv-bot commit_user_email: 84861620+iptv-bot[bot]@users.noreply.github.com commit_author: 'iptv-bot[bot] <84861620+iptv-bot[bot]@users.noreply.github.com>' - branch: bot/auto-update + branch: ${{ needs.create-branch.outputs.branch_name }} file_pattern: channels/* generate: runs-on: ubuntu-latest - needs: filter + needs: [filter, create-branch] steps: - name: Checkout uses: actions/checkout@v2 with: - ref: bot/auto-update + ref: ${{ needs.create-branch.outputs.branch_name }} - name: Setup Node uses: actions/setup-node@v2 with: @@ -198,12 +194,12 @@ jobs: path: .gh-pages/ deploy: runs-on: ubuntu-latest - needs: generate + needs: [generate, create-branch] steps: - name: Checkout uses: actions/checkout@v2 with: - ref: bot/auto-update + ref: ${{ needs.create-branch.outputs.branch_name }} - name: Download Artifacts uses: actions/download-artifact@v2 with: @@ -227,12 +223,12 @@ jobs: commit-message: '[Bot] Deploy to GitHub Pages' update-readme: runs-on: ubuntu-latest - needs: generate + needs: [generate, create-branch] steps: - name: Checkout uses: actions/checkout@v2 with: - ref: bot/auto-update + ref: ${{ needs.create-branch.outputs.branch_name }} - name: Setup Node uses: actions/setup-node@v2 with: @@ -249,17 +245,17 @@ jobs: commit_user_name: iptv-bot commit_user_email: 84861620+iptv-bot[bot]@users.noreply.github.com commit_author: 'iptv-bot[bot] <84861620+iptv-bot[bot]@users.noreply.github.com>' - branch: bot/auto-update + branch: ${{ needs.create-branch.outputs.branch_name }} file_pattern: README.md pull-request: if: ${{ github.ref == 'refs/heads/master' }} - needs: update-readme + needs: [update-readme, create-branch] runs-on: ubuntu-latest steps: - name: Checkout uses: actions/checkout@v2 with: - ref: bot/auto-update + ref: ${{ needs.create-branch.outputs.branch_name }} - name: Generate Token uses: tibdex/github-app-token@v1 id: generate-token @@ -270,7 +266,7 @@ jobs: id: pr uses: repo-sync/pull-request@v2 with: - source_branch: 'bot/auto-update' + source_branch: ${{ needs.create-branch.outputs.branch_name }} destination_branch: 'master' pr_title: '[Bot] Update playlists' pr_body: | From b9d936d56b49772146dacb54044c99c834ad882c Mon Sep 17 00:00:00 2001 From: Aleksandr Statciuk Date: Sat, 27 Nov 2021 02:28:05 +0300 Subject: [PATCH 7/7] Update auto-update.yml --- .github/workflows/auto-update.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/auto-update.yml b/.github/workflows/auto-update.yml index 3c481b4b15..dec1f3be64 100644 --- a/.github/workflows/auto-update.yml +++ b/.github/workflows/auto-update.yml @@ -64,7 +64,7 @@ jobs: - name: Install Dependencies run: npm install - name: Format Playlists - run: node scripts/format.js --country=${{ matrix.country }} --debug --offline + run: node scripts/format.js --country=${{ matrix.country }} --debug - name: Upload Artifact uses: actions/upload-artifact@v2 with: