diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml deleted file mode 100644 index 03c56780f..000000000 --- a/.github/workflows/build.yml +++ /dev/null @@ -1,41 +0,0 @@ -name: TorrentPier nightly builder - -on: - push: - branches: - - master - -jobs: - build: - runs-on: ubuntu-latest - - steps: - - name: Checkout code - uses: actions/checkout@v4 - - - name: Setup PHP - uses: shivammathur/setup-php@v2 - with: - php-version: '8.1' - - - name: Install Composer dependencies - run: composer install --no-progress --prefer-dist --optimize-autoloader - - - name: Get commit hash - id: get_commit_hash - run: | - COMMIT_HASH=$(git rev-parse --short HEAD) - echo "COMMIT_HASH=$COMMIT_HASH" >> $GITHUB_OUTPUT - - - name: Create archive - id: create_zip - run: | - ZIP_NAME="torrentpier-${{ steps.get_commit_hash.outputs.COMMIT_HASH }}.zip" - zip -r "$ZIP_NAME" . -x ".git/*" ".github/*" - echo "ZIP_NAME=$ZIP_NAME" >> $GITHUB_OUTPUT - - - name: Upload Archive - uses: actions/upload-artifact@v4 - with: - name: TorrentPier - path: ${{ steps.create_zip.outputs.ZIP_NAME }} diff --git a/.github/workflows/cd.yml b/.github/workflows/cd.yml new file mode 100644 index 000000000..f70970ce6 --- /dev/null +++ b/.github/workflows/cd.yml @@ -0,0 +1,71 @@ +name: Continuous Deployment + +on: + push: + tags: + - "v*.*.*" + +jobs: + changelog: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v4 + with: + fetch-depth: 0 + ref: master + token: ${{ secrets.REPO_TOKEN }} + + - name: Generate a changelog + uses: orhun/git-cliff-action@v4 + id: git-cliff + with: + config: cliff.toml + args: v2.4.5-rc.2.. --verbose + env: + OUTPUT: CHANGELOG.md + GITHUB_REPO: ${{ github.repository }} + + - name: Print the changelog + run: cat "${{ steps.git-cliff.outputs.changelog }}" + + - name: Commit changelog + run: | + git checkout master + git config --local user.name 'belomaxorka' + git config --local user.email 'roman25052006.kelesh@gmail.com' + set +e + git add CHANGELOG.md + git commit -m "release(preparing): Update CHANGELOG.md 📖" + git push https://${{ secrets.GITHUB_TOKEN }}@github.com/${{ github.repository }}.git master + + checksums: + runs-on: ubuntu-latest + needs: + - changelog + steps: + - name: Checkout + uses: actions/checkout@v4 + with: + fetch-depth: 0 + ref: master + token: ${{ secrets.REPO_TOKEN }} + + - name: Generate checksums.md5 file + run: | + find . -type f -not -path "./.git/*" -exec md5sum {} \; > internal_data/checksums.md5 + + - name: Commit and push checksums.md5 if changed + run: | + git checkout master + git config --local user.name 'belomaxorka' + git config --local user.email 'roman25052006.kelesh@gmail.com' + + if git diff --quiet internal_data/checksums.md5; then + echo "No changes in internal_data/checksums.md5" + else + set +e + git add internal_data/checksums.md5 + git commit -m "release(preparing): Update checksums.md5 📄" + git push https://${{ secrets.GITHUB_TOKEN }}@github.com/${{ github.repository }}.git master + fi diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 1c4824995..e1579e9a1 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1,4 +1,4 @@ -name: Continuous integration +name: Continuous Integration on: push: @@ -6,66 +6,65 @@ on: - master jobs: - changelog: + nightly: + runs-on: ubuntu-latest + + steps: + - name: Checkout code + uses: actions/checkout@v4 + + - name: Setup PHP + uses: shivammathur/setup-php@v2 + with: + php-version: '8.1' + + - name: Install Composer dependencies + run: composer install --no-progress --prefer-dist --optimize-autoloader + + - name: Get commit hash + id: get_commit_hash + run: | + COMMIT_HASH=$(git rev-parse --short HEAD) + echo "COMMIT_HASH=$COMMIT_HASH" >> $GITHUB_OUTPUT + + - name: Create archive + id: create_zip + run: | + ZIP_NAME="torrentpier-${{ steps.get_commit_hash.outputs.COMMIT_HASH }}.zip" + zip -r "$ZIP_NAME" . -x ".git/*" ".github/*" + echo "ZIP_NAME=$ZIP_NAME" >> $GITHUB_OUTPUT + + - name: Upload Archive + uses: actions/upload-artifact@v4 + with: + name: TorrentPier + path: ${{ steps.create_zip.outputs.ZIP_NAME }} + + deploy: + name: 🎉 Deploy runs-on: ubuntu-latest steps: - - name: Checkout + - name: 🚚 Get latest code uses: actions/checkout@v4 + + - name: 🔩 Setup PHP + uses: shivammathur/setup-php@v2 with: - fetch-depth: 0 - ref: master - token: ${{ secrets.REPO_TOKEN }} + php-version: '8.1' - - name: Generate a changelog - uses: orhun/git-cliff-action@v4 - id: git-cliff + - name: 🖇 Install Composer dependencies + run: composer install --no-progress --prefer-dist --optimize-autoloader + + - name: 📂 Sync files + uses: SamKirkland/FTP-Deploy-Action@v4.3.5 with: - config: cliff.toml - args: v2.4.5-rc.2.. --verbose - env: - OUTPUT: CHANGELOG.md - GITHUB_REPO: ${{ github.repository }} - - - name: Print the changelog - run: cat "${{ steps.git-cliff.outputs.changelog }}" - - - name: Commit changelog - run: | - git checkout master - git config --local user.name 'belomaxorka' - git config --local user.email 'roman25052006.kelesh@gmail.com' - set +e - git add CHANGELOG.md - git commit -m "Update CHANGELOG.md 📖" - git push https://${{ secrets.GITHUB_TOKEN }}@github.com/${{ github.repository }}.git master - - checksums: - runs-on: ubuntu-latest - needs: - - changelog - steps: - - name: Checkout - uses: actions/checkout@v4 - with: - fetch-depth: 0 - ref: master - token: ${{ secrets.REPO_TOKEN }} - - - name: Generate checksums.md5 file - run: | - find . -type f -not -path "./.git/*" -exec md5sum {} \; > internal_data/checksums.md5 - - - name: Commit and push checksums.md5 if changed - run: | - git checkout master - git config --local user.name 'belomaxorka' - git config --local user.email 'roman25052006.kelesh@gmail.com' - - if git diff --quiet internal_data/checksums.md5; then - echo "No changes in internal_data/checksums.md5" - else - set +e - git add internal_data/checksums.md5 - git commit -m "Update checksums.md5 📄" - git push https://${{ secrets.GITHUB_TOKEN }}@github.com/${{ github.repository }}.git master - fi + server: ${{ secrets.FTP_SERVER }} + username: ${{ secrets.FTP_USERNAME }} + password: ${{ secrets.FTP_PASSWORD }} + server-dir: ${{ secrets.FTP_DIR }} + protocol: ${{ secrets.FTP_PROTOCOL }} + port: ${{ secrets.FTP_PORT }} + exclude: | + **/.git* + **/.git*/** + .env diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml deleted file mode 100644 index 868d8645e..000000000 --- a/.github/workflows/deploy.yml +++ /dev/null @@ -1,36 +0,0 @@ -name: Deploy to TorrentPier Demo - -on: - push: - branches: - - master - -jobs: - deploy: - name: 🎉 Deploy - runs-on: ubuntu-latest - steps: - - name: 🚚 Get latest code - uses: actions/checkout@v4 - - - name: 🔩 Setup PHP - uses: shivammathur/setup-php@v2 - with: - php-version: '8.1' - - - name: 🖇 Install Composer dependencies - run: composer install --no-progress --prefer-dist --optimize-autoloader - - - name: 📂 Sync files - uses: SamKirkland/FTP-Deploy-Action@v4.3.5 - with: - server: ${{ secrets.FTP_SERVER }} - username: ${{ secrets.FTP_USERNAME }} - password: ${{ secrets.FTP_PASSWORD }} - server-dir: ${{ secrets.FTP_DIR }} - protocol: ${{ secrets.FTP_PROTOCOL }} - port: ${{ secrets.FTP_PORT }} - exclude: | - **/.git* - **/.git*/** - .env diff --git a/library/includes/datastore/build_files_integrity.php b/library/includes/datastore/build_files_integrity.php index 4825c5bad..8ea0ab5d2 100644 --- a/library/includes/datastore/build_files_integrity.php +++ b/library/includes/datastore/build_files_integrity.php @@ -13,7 +13,7 @@ if (!defined('BB_ROOT')) { global $bb_cfg; -if (!$bb_cfg['integrity_check']) { +if (!$bb_cfg['integrity_check'] || APP_ENV === 'local') { return; }