From 459628cce80ed78c6837f48e19ec029e3a6631b0 Mon Sep 17 00:00:00 2001 From: Aleksandr Statciuk Date: Tue, 14 Dec 2021 05:32:32 +0300 Subject: [PATCH 1/4] Update auto-update.yml --- .github/workflows/auto-update.yml | 48 ++++++++++++++++++------------- 1 file changed, 28 insertions(+), 20 deletions(-) diff --git a/.github/workflows/auto-update.yml b/.github/workflows/auto-update.yml index d50866cc1..296553bf9 100644 --- a/.github/workflows/auto-update.yml +++ b/.github/workflows/auto-update.yml @@ -14,7 +14,7 @@ jobs: node-version: '14' cache: 'npm' - run: npm install - - run: node scripts/commands/create-database.js + - run: node scripts/commands/create-database.js --max-clusters=10000 - run: node scripts/commands/create-matrix.js id: create-matrix - uses: actions/upload-artifact@v2 @@ -29,7 +29,9 @@ jobs: continue-on-error: true strategy: fail-fast: false - matrix: ${{ fromJson(needs.setup.outputs.matrix) }} + # matrix: ${{ fromJson(needs.setup.outputs.matrix) }} + matrix: + cluster_id: [1] steps: - uses: actions/checkout@v2 - uses: actions/download-artifact@v2 @@ -51,13 +53,25 @@ jobs: runs-on: ubuntu-latest needs: load steps: - - uses: actions/checkout@v2 + - uses: tibdex/github-app-token@v1 + if: ${{ !env.ACT }} + id: create-app-token + with: + app_id: ${{ secrets.APP_ID }} + private_key: ${{ secrets.APP_PRIVATE_KEY }} - run: echo "::set-output name=branch_name::$(date +'bot/auto-update-%s')" id: create-branch-name + - uses: peterjgrainger/action-create-branch@v2.0.1 + env: + GITHUB_TOKEN: ${{ steps.create-app-token.outputs.token }} + with: + branch: ${{ steps.create-branch-name.outputs.branch_name }} + - uses: actions/checkout@v2 + with: + ref: ${{ steps.create-branch-name.outputs.branch_name }} - run: | git config user.name 'iptv-bot[bot]' git config user.email '84861620+iptv-bot[bot]@users.noreply.github.com' - - run: git checkout -b ${{ steps.create-branch-name.outputs.branch_name }} - run: curl -L -o scripts/data/codes.json https://iptv-org.github.io/epg/codes.json - uses: actions/download-artifact@v2 with: @@ -86,23 +100,8 @@ jobs: - run: | git add README.md git commit -m "[Bot] Update README.md" - - uses: tibdex/github-app-token@v1 - if: ${{ !env.ACT }} - id: create-app-token - with: - app_id: ${{ secrets.APP_ID }} - private_key: ${{ secrets.APP_PRIVATE_KEY }} - - uses: JamesIves/github-pages-deploy-action@4.1.1 - if: ${{ github.ref == 'refs/heads/master' }} - with: - branch: gh-pages - folder: .gh-pages - token: ${{ steps.create-app-token.outputs.token }} - git-config-name: iptv-bot[bot] - git-config-email: 84861620+iptv-bot[bot]@users.noreply.github.com - commit-message: '[Bot] Generate playlists' - uses: repo-sync/pull-request@v2 - if: ${{ github.ref == 'refs/heads/master' }} + # if: ${{ github.ref == 'refs/heads/master' }} id: pull-request with: github_token: ${{ steps.create-app-token.outputs.token }} @@ -119,3 +118,12 @@ jobs: github-token: ${{ secrets.PAT }} number: ${{ steps.pull-request.outputs.pr_number }} method: squash + - uses: JamesIves/github-pages-deploy-action@4.1.1 + if: ${{ github.ref == 'refs/heads/master' }} + with: + branch: gh-pages + folder: .gh-pages + token: ${{ steps.create-app-token.outputs.token }} + git-config-name: iptv-bot[bot] + git-config-email: 84861620+iptv-bot[bot]@users.noreply.github.com + commit-message: '[Bot] Generate playlists' From f53e698fb08b766e8bb416e8c66ade83b5509b28 Mon Sep 17 00:00:00 2001 From: Aleksandr Statciuk Date: Tue, 14 Dec 2021 06:05:36 +0300 Subject: [PATCH 2/4] Update auto-update.yml --- .github/workflows/auto-update.yml | 40 +++++++++++++------------------ 1 file changed, 16 insertions(+), 24 deletions(-) diff --git a/.github/workflows/auto-update.yml b/.github/workflows/auto-update.yml index 296553bf9..d63818300 100644 --- a/.github/workflows/auto-update.yml +++ b/.github/workflows/auto-update.yml @@ -53,25 +53,12 @@ jobs: runs-on: ubuntu-latest needs: load steps: - - uses: tibdex/github-app-token@v1 - if: ${{ !env.ACT }} - id: create-app-token - with: - app_id: ${{ secrets.APP_ID }} - private_key: ${{ secrets.APP_PRIVATE_KEY }} + - uses: actions/checkout@v2 - run: echo "::set-output name=branch_name::$(date +'bot/auto-update-%s')" id: create-branch-name - - uses: peterjgrainger/action-create-branch@v2.0.1 - env: - GITHUB_TOKEN: ${{ steps.create-app-token.outputs.token }} - with: - branch: ${{ steps.create-branch-name.outputs.branch_name }} - - uses: actions/checkout@v2 - with: - ref: ${{ steps.create-branch-name.outputs.branch_name }} - - run: | - git config user.name 'iptv-bot[bot]' - git config user.email '84861620+iptv-bot[bot]@users.noreply.github.com' + - run: git config user.name 'iptv-bot[bot]' + - run: git config user.email '84861620+iptv-bot[bot]@users.noreply.github.com' + - run: git checkout -b ${{ steps.create-branch-name.outputs.branch_name }} - run: curl -L -o scripts/data/codes.json https://iptv-org.github.io/epg/codes.json - uses: actions/download-artifact@v2 with: @@ -88,20 +75,25 @@ jobs: name: database path: scripts/channels.db - run: node scripts/commands/update-playlists.js - - run: | - git add channels/* - git commit -m "[Bot] Update playlists" + - run: git add channels/* + - run: git commit -m "[Bot] Update playlists" - run: node scripts/commands/generate-playlists.js - uses: actions/upload-artifact@v2 with: name: logs path: scripts/logs - run: node scripts/commands/update-readme.js - - run: | - git add README.md - git commit -m "[Bot] Update README.md" + - run: git add README.md + - run: git commit -m "[Bot] Update README.md" + - run: git push -u origin ${{ steps.create-branch-name.outputs.branch_name }} + - uses: tibdex/github-app-token@v1 + if: ${{ !env.ACT }} + id: create-app-token + with: + app_id: ${{ secrets.APP_ID }} + private_key: ${{ secrets.APP_PRIVATE_KEY }} - uses: repo-sync/pull-request@v2 - # if: ${{ github.ref == 'refs/heads/master' }} + if: ${{ !env.ACT }} id: pull-request with: github_token: ${{ steps.create-app-token.outputs.token }} From 8d503447d04cbe7b631a53df4cf28897ab7c6f6d Mon Sep 17 00:00:00 2001 From: Aleksandr Statciuk Date: Tue, 14 Dec 2021 06:14:31 +0300 Subject: [PATCH 3/4] Update auto-update.yml --- .github/workflows/auto-update.yml | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/.github/workflows/auto-update.yml b/.github/workflows/auto-update.yml index d63818300..843b7dda3 100644 --- a/.github/workflows/auto-update.yml +++ b/.github/workflows/auto-update.yml @@ -14,7 +14,7 @@ jobs: node-version: '14' cache: 'npm' - run: npm install - - run: node scripts/commands/create-database.js --max-clusters=10000 + - run: node scripts/commands/create-database.js - run: node scripts/commands/create-matrix.js id: create-matrix - uses: actions/upload-artifact@v2 @@ -29,9 +29,7 @@ jobs: continue-on-error: true strategy: fail-fast: false - # matrix: ${{ fromJson(needs.setup.outputs.matrix) }} - matrix: - cluster_id: [1] + matrix: ${{ fromJson(needs.setup.outputs.matrix) }} steps: - uses: actions/checkout@v2 - uses: actions/download-artifact@v2 @@ -68,6 +66,10 @@ jobs: with: name: logs path: scripts/logs + - uses: actions/setup-node@v2 + if: ${{ !env.ACT }} + with: + node-version: '14' - run: npm install - run: node scripts/commands/update-database.js - uses: actions/upload-artifact@v2 From f8b3af7c7f151fd55cc826e9d971e582e85c15ec Mon Sep 17 00:00:00 2001 From: Aleksandr Statciuk Date: Tue, 14 Dec 2021 06:15:35 +0300 Subject: [PATCH 4/4] 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 843b7dda3..49a504d1b 100644 --- a/.github/workflows/auto-update.yml +++ b/.github/workflows/auto-update.yml @@ -101,7 +101,7 @@ jobs: github_token: ${{ steps.create-app-token.outputs.token }} source_branch: ${{ steps.create-branch-name.outputs.branch_name }} destination_branch: 'master' - pr_title: '[Bot] Daily playlists update' + pr_title: '[Bot] Daily update' pr_body: | This pull request is created by [auto-update][1] workflow.