From 958d2233fd014c72144913ff832919d171346ba6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ya=C4=9F=C4=B1zhan=20Burak=20Yakar?= Date: Wed, 8 Dec 2021 19:25:09 +0300 Subject: [PATCH 01/11] Create artifact.yml --- .github/workflows/artifact.yml | 80 ++++++++++++++++++++++++++++++++++ 1 file changed, 80 insertions(+) create mode 100644 .github/workflows/artifact.yml diff --git a/.github/workflows/artifact.yml b/.github/workflows/artifact.yml new file mode 100644 index 000000000..55ffd1fe1 --- /dev/null +++ b/.github/workflows/artifact.yml @@ -0,0 +1,80 @@ +name: Create a downloadable preview build + +on: + push: + branches: [ master ] + pull_request: + branches: [ master ] + +jobs: + build: + runs-on: ${{ matrix.operating-system }} + strategy: + matrix: + operating-system: [ubuntu-latest] + php-versions: ['7.4'] + + name: Create a downloadable preview build + steps: + - name: Checkout + uses: actions/checkout@v2 + + - name: Install PHP + uses: shivammathur/setup-php@v2 + with: + php-version: ${{ matrix.php-versions }} + + - name: Install Node.js + uses: actions/setup-node@v2 + with: + node-version: '16' + + - name: Check PHP Version + run: php -v + + - name: Validate composer.json and composer.lock + run: composer validate + working-directory: ./src + + - name: Install Grunt-CLI + run: npm install -g grunt-cli + + - name: Installing NPM dependencies + run: npm install + + - name: Create temporary directories and files + run: | + mkdir -p ./src/bb-data/{cache,log,uploads} + touch ./src/bb-data/{cache,log,uploads}/index.html + mkdir -p ./build/{code-browser,code-coverage,logs,pdepend,update,distribution,source} + + - name: Copy mandatory files to the temporary build folder + run: | + cp ./src/* ./build/source/ + cp README.md ./build/source/ + cp LICENSE ./build/source/ + cp CHANGELOG.md ./build/source/ + + - name: Running Grunt + run: grunt + working-directory: ./build/source + + - name: Installing Composer dependencies + run: composer install --prefer-dist --no-progress --no-suggest --no-dev --optimize-autoloader + working-directory: ./build/source + + - name: Add short commit hash as the release number + run: | + sed s/0.0.1/${GITHUB_SHA::6}/ Version.php > Version2.php + mv Version2.php Version.php + working-directory: ./build/source/bb-library/Box + + - name: Create the final archive + run: zip –r BoxBilling-${GITHUB_SHA::6}.zip ../source + working-directory: ./build/distribution + + - name: Upload the final artifact + uses: actions/upload-artifact@v2 + with: + name: BoxBilling-${GITHUB_SHA::6} + path: ./build/distribution/BoxBilling-${GITHUB_SHA::6}.zip From 1bfdbae2b518269b301009db9b34d46946bff1f5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ya=C4=9F=C4=B1zhan=20Burak=20Yakar?= Date: Wed, 8 Dec 2021 19:31:02 +0300 Subject: [PATCH 02/11] Update artifact.yml --- .github/workflows/artifact.yml | 80 +++++++++++++++++----------------- 1 file changed, 40 insertions(+), 40 deletions(-) diff --git a/.github/workflows/artifact.yml b/.github/workflows/artifact.yml index 55ffd1fe1..06a0646ee 100644 --- a/.github/workflows/artifact.yml +++ b/.github/workflows/artifact.yml @@ -9,72 +9,72 @@ on: jobs: build: runs-on: ${{ matrix.operating-system }} - strategy: - matrix: - operating-system: [ubuntu-latest] - php-versions: ['7.4'] + strategy: + matrix: + operating-system: [ubuntu-latest] + php-versions: ['7.4'] name: Create a downloadable preview build - steps: + steps: - name: Checkout - uses: actions/checkout@v2 + uses: actions/checkout@v2 - name: Install PHP - uses: shivammathur/setup-php@v2 - with: - php-version: ${{ matrix.php-versions }} + uses: shivammathur/setup-php@v2 + with: + php-version: ${{ matrix.php-versions }} - name: Install Node.js - uses: actions/setup-node@v2 - with: - node-version: '16' + uses: actions/setup-node@v2 + with: + node-version: '16' - name: Check PHP Version - run: php -v + run: php -v - name: Validate composer.json and composer.lock - run: composer validate - working-directory: ./src + run: composer validate + working-directory: ./src - name: Install Grunt-CLI - run: npm install -g grunt-cli + run: npm install -g grunt-cli - name: Installing NPM dependencies - run: npm install + run: npm install - name: Create temporary directories and files - run: | - mkdir -p ./src/bb-data/{cache,log,uploads} - touch ./src/bb-data/{cache,log,uploads}/index.html - mkdir -p ./build/{code-browser,code-coverage,logs,pdepend,update,distribution,source} + run: | + mkdir -p ./src/bb-data/{cache,log,uploads} + touch ./src/bb-data/{cache,log,uploads}/index.html + mkdir -p ./build/{code-browser,code-coverage,logs,pdepend,update,distribution,source} - name: Copy mandatory files to the temporary build folder - run: | - cp ./src/* ./build/source/ - cp README.md ./build/source/ - cp LICENSE ./build/source/ - cp CHANGELOG.md ./build/source/ + run: | + cp ./src/* ./build/source/ + cp README.md ./build/source/ + cp LICENSE ./build/source/ + cp CHANGELOG.md ./build/source/ - name: Running Grunt - run: grunt - working-directory: ./build/source + run: grunt + working-directory: ./build/source - name: Installing Composer dependencies - run: composer install --prefer-dist --no-progress --no-suggest --no-dev --optimize-autoloader - working-directory: ./build/source + run: composer install --prefer-dist --no-progress --no-suggest --no-dev --optimize-autoloader + working-directory: ./build/source - name: Add short commit hash as the release number - run: | - sed s/0.0.1/${GITHUB_SHA::6}/ Version.php > Version2.php - mv Version2.php Version.php - working-directory: ./build/source/bb-library/Box + run: | + sed s/0.0.1/${GITHUB_SHA::7}/ Version.php > Version2.php + mv Version2.php Version.php + working-directory: ./build/source/bb-library/Box - name: Create the final archive - run: zip –r BoxBilling-${GITHUB_SHA::6}.zip ../source - working-directory: ./build/distribution + run: zip –r BoxBilling-${GITHUB_SHA::7}.zip ../source + working-directory: ./build/distribution - name: Upload the final artifact - uses: actions/upload-artifact@v2 - with: - name: BoxBilling-${GITHUB_SHA::6} - path: ./build/distribution/BoxBilling-${GITHUB_SHA::6}.zip + uses: actions/upload-artifact@v2 + with: + name: BoxBilling-${GITHUB_SHA::7} + path: ./build/distribution/BoxBilling-${GITHUB_SHA::7}.zip From b93f9966415343bd98d606bc7d01307e8cf68a10 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ya=C4=9F=C4=B1zhan=20Burak=20Yakar?= Date: Wed, 8 Dec 2021 19:32:50 +0300 Subject: [PATCH 03/11] trailing spaces and stuff --- .github/workflows/artifact.yml | 34 +++++++++++++++++----------------- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/.github/workflows/artifact.yml b/.github/workflows/artifact.yml index 06a0646ee..7eb8b9869 100644 --- a/.github/workflows/artifact.yml +++ b/.github/workflows/artifact.yml @@ -2,9 +2,9 @@ name: Create a downloadable preview build on: push: - branches: [ master ] + branches: [master] pull_request: - branches: [ master ] + branches: [master] jobs: build: @@ -12,67 +12,67 @@ jobs: strategy: matrix: operating-system: [ubuntu-latest] - php-versions: ['7.4'] + php-versions: ["7.4"] name: Create a downloadable preview build steps: - name: Checkout uses: actions/checkout@v2 - + - name: Install PHP uses: shivammathur/setup-php@v2 with: php-version: ${{ matrix.php-versions }} - + - name: Install Node.js uses: actions/setup-node@v2 with: - node-version: '16' + node-version: "16" - name: Check PHP Version run: php -v - + - name: Validate composer.json and composer.lock run: composer validate working-directory: ./src - + - name: Install Grunt-CLI run: npm install -g grunt-cli - + - name: Installing NPM dependencies run: npm install - + - name: Create temporary directories and files run: | mkdir -p ./src/bb-data/{cache,log,uploads} touch ./src/bb-data/{cache,log,uploads}/index.html mkdir -p ./build/{code-browser,code-coverage,logs,pdepend,update,distribution,source} - + - name: Copy mandatory files to the temporary build folder - run: | + run: | cp ./src/* ./build/source/ cp README.md ./build/source/ cp LICENSE ./build/source/ cp CHANGELOG.md ./build/source/ - + - name: Running Grunt run: grunt working-directory: ./build/source - + - name: Installing Composer dependencies run: composer install --prefer-dist --no-progress --no-suggest --no-dev --optimize-autoloader working-directory: ./build/source - + - name: Add short commit hash as the release number run: | sed s/0.0.1/${GITHUB_SHA::7}/ Version.php > Version2.php mv Version2.php Version.php working-directory: ./build/source/bb-library/Box - + - name: Create the final archive run: zip –r BoxBilling-${GITHUB_SHA::7}.zip ../source working-directory: ./build/distribution - + - name: Upload the final artifact uses: actions/upload-artifact@v2 with: From 1d367e9b517954797a6ab5e9088d50d0698f409c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ya=C4=9F=C4=B1zhan=20Burak=20Yakar?= Date: Wed, 8 Dec 2021 19:33:34 +0300 Subject: [PATCH 04/11] copy recursively. --- .github/workflows/artifact.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/artifact.yml b/.github/workflows/artifact.yml index 7eb8b9869..b95ff0332 100644 --- a/.github/workflows/artifact.yml +++ b/.github/workflows/artifact.yml @@ -50,7 +50,7 @@ jobs: - name: Copy mandatory files to the temporary build folder run: | - cp ./src/* ./build/source/ + cp -r ./src/* ./build/source/ cp README.md ./build/source/ cp LICENSE ./build/source/ cp CHANGELOG.md ./build/source/ From c4a6c42752c29ffbc06df852b11b1050ecf869dc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ya=C4=9F=C4=B1zhan=20Burak=20Yakar?= Date: Wed, 8 Dec 2021 19:36:32 +0300 Subject: [PATCH 05/11] Update artifact.yml --- .github/workflows/artifact.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/artifact.yml b/.github/workflows/artifact.yml index b95ff0332..c581d9b2f 100644 --- a/.github/workflows/artifact.yml +++ b/.github/workflows/artifact.yml @@ -77,4 +77,4 @@ jobs: uses: actions/upload-artifact@v2 with: name: BoxBilling-${GITHUB_SHA::7} - path: ./build/distribution/BoxBilling-${GITHUB_SHA::7}.zip + path: ./build/distribution/ From dae61d6c98226b5d2039cdf507eca07e16e2fe8b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ya=C4=9F=C4=B1zhan=20Burak=20Yakar?= Date: Wed, 8 Dec 2021 19:37:04 +0300 Subject: [PATCH 06/11] well --- .github/workflows/artifact.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/artifact.yml b/.github/workflows/artifact.yml index c581d9b2f..34d13202c 100644 --- a/.github/workflows/artifact.yml +++ b/.github/workflows/artifact.yml @@ -78,3 +78,4 @@ jobs: with: name: BoxBilling-${GITHUB_SHA::7} path: ./build/distribution/ + if-no-files-found: error From 1f4abc6455cd6a060580f56c6415da7585840c3d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ya=C4=9F=C4=B1zhan=20Burak=20Yakar?= Date: Wed, 8 Dec 2021 19:39:09 +0300 Subject: [PATCH 07/11] Update artifact.yml --- .github/workflows/artifact.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/artifact.yml b/.github/workflows/artifact.yml index 34d13202c..7cc9ec95a 100644 --- a/.github/workflows/artifact.yml +++ b/.github/workflows/artifact.yml @@ -76,6 +76,6 @@ jobs: - name: Upload the final artifact uses: actions/upload-artifact@v2 with: - name: BoxBilling-${GITHUB_SHA::7} + name: BoxBilling Preview Archive path: ./build/distribution/ if-no-files-found: error From b7647214275c129a1f7ec8c9292f86a87dcdd59f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ya=C4=9F=C4=B1zhan=20Burak=20Yakar?= Date: Wed, 8 Dec 2021 19:49:41 +0300 Subject: [PATCH 08/11] verbose --- .github/workflows/artifact.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/artifact.yml b/.github/workflows/artifact.yml index 7cc9ec95a..2d842f4a3 100644 --- a/.github/workflows/artifact.yml +++ b/.github/workflows/artifact.yml @@ -70,7 +70,7 @@ jobs: working-directory: ./build/source/bb-library/Box - name: Create the final archive - run: zip –r BoxBilling-${GITHUB_SHA::7}.zip ../source + run: zip -v –r BoxBilling-${GITHUB_SHA::7}.zip ../source/* working-directory: ./build/distribution - name: Upload the final artifact From 10c9ccba3fd8b3e664f6341b93a9241156038207 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ya=C4=9F=C4=B1zhan=20Burak=20Yakar?= Date: Wed, 8 Dec 2021 20:25:45 +0300 Subject: [PATCH 09/11] let's go with TAR instead --- .github/workflows/artifact.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/artifact.yml b/.github/workflows/artifact.yml index 2d842f4a3..799f216e0 100644 --- a/.github/workflows/artifact.yml +++ b/.github/workflows/artifact.yml @@ -70,8 +70,7 @@ jobs: working-directory: ./build/source/bb-library/Box - name: Create the final archive - run: zip -v –r BoxBilling-${GITHUB_SHA::7}.zip ../source/* - working-directory: ./build/distribution + run: tar cvf ./build/distribution/BoxBilling-${GITHUB_SHA::7}.tar ./build/source - name: Upload the final artifact uses: actions/upload-artifact@v2 From 848c0c8ac2c568581974f1bfaec417a308feb1c3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ya=C4=9F=C4=B1zhan=20Burak=20Yakar?= Date: Wed, 8 Dec 2021 20:36:23 +0300 Subject: [PATCH 10/11] -C --- .github/workflows/artifact.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/artifact.yml b/.github/workflows/artifact.yml index 799f216e0..324d43a80 100644 --- a/.github/workflows/artifact.yml +++ b/.github/workflows/artifact.yml @@ -70,7 +70,7 @@ jobs: working-directory: ./build/source/bb-library/Box - name: Create the final archive - run: tar cvf ./build/distribution/BoxBilling-${GITHUB_SHA::7}.tar ./build/source + run: tar cvf ./build/distribution/BoxBilling-${GITHUB_SHA::7}.tar -C ./build/source . - name: Upload the final artifact uses: actions/upload-artifact@v2 From ab7a99cf5f284a4e29c627e4dff70e1884d2aeec Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ya=C4=9F=C4=B1zhan=20Burak=20Yakar?= Date: Sun, 12 Dec 2021 11:47:37 +0300 Subject: [PATCH 11/11] dummy edit to trigger travis