From 60eae57685a2f7daa2fcbf8aeaae845a5a44bd42 Mon Sep 17 00:00:00 2001 From: turegjorup Date: Tue, 29 Jul 2025 10:52:30 +0200 Subject: [PATCH 1/6] Add build release jobs to standard github actions --- .../.github/workflows/build_release.yml | 48 +++++++++++++++++++ .../.github/workflows/build_release.yml | 48 +++++++++++++++++++ 2 files changed, 96 insertions(+) create mode 100644 templates/drupal-11/.github/workflows/build_release.yml create mode 100644 templates/symfony-6/.github/workflows/build_release.yml diff --git a/templates/drupal-11/.github/workflows/build_release.yml b/templates/drupal-11/.github/workflows/build_release.yml new file mode 100644 index 0000000..45f52fb --- /dev/null +++ b/templates/drupal-11/.github/workflows/build_release.yml @@ -0,0 +1,48 @@ +on: + push: + tags: + - '*.*.*' + +name: Create Github Release + +permissions: + contents: write + +env: + COMPOSE_USER: runner + +jobs: + create-release: + runs-on: ubuntu-latest + env: + COMPOSER_ALLOW_SUPERUSER: 1 + APP_ENV: prod + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Composer install + run: | + docker network create frontend + docker compose run --rm --user=root phpfpm composer install --no-dev -o --classmap-authoritative + docker compose run --rm --user=root phpfpm composer clear-cache + + - name: Make assets dir + run: | + mkdir -p ../assets + + - name: Create archive + run: | + sudo chown -R runner:runner ./ + tar --exclude='.git' -zcf ../assets/${{ github.event.repository.name }}-${{ github.ref_name }}.tar.gz ./ + + - name: Create checksum + run: | + cd ../assets + sha256sum ${{ github.event.repository.name }}-${{ github.ref_name }}.tar.gz > ../assets/checksum.txt + + - name: Create a release in GitHub and uploads assets + run: gh release create ${{ github.ref_name }} --verify-tag --generate-notes ../assets/*.* + env: + GITHUB_TOKEN: ${{ github.TOKEN }} + shell: bash \ No newline at end of file diff --git a/templates/symfony-6/.github/workflows/build_release.yml b/templates/symfony-6/.github/workflows/build_release.yml new file mode 100644 index 0000000..7ec26ba --- /dev/null +++ b/templates/symfony-6/.github/workflows/build_release.yml @@ -0,0 +1,48 @@ +on: + push: + tags: + - '*.*.*' + +name: Create Github Release + +permissions: + contents: write + +env: + COMPOSE_USER: runner + +jobs: + create-release: + runs-on: ubuntu-latest + env: + COMPOSER_ALLOW_SUPERUSER: 1 + APP_ENV: prod + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Composer install + run: | + docker network create frontend + docker compose run --rm --user=root -e APP_ENV=prod phpfpm composer install --no-dev --optimize-autoloader + docker compose run --rm --user=root -e APP_ENV=prod phpfpm composer clear-cache + + - name: Make assets dir + run: | + mkdir -p ../assets + + - name: Create archive + run: | + sudo chown -R runner:runner ./ + tar --exclude='.git' -zcf ../assets/${{ github.event.repository.name }}-${{ github.ref_name }}.tar.gz ./ + + - name: Create checksum + run: | + cd ../assets + sha256sum ${{ github.event.repository.name }}-${{ github.ref_name }}.tar.gz > ../assets/checksum.txt + + - name: Create a release in GitHub and uploads assets + run: gh release create ${{ github.ref_name }} --verify-tag --generate-notes ../assets/*.* + env: + GITHUB_TOKEN: ${{ github.TOKEN }} + shell: bash \ No newline at end of file From 50ca62529453b374996d50ef2651497893886095 Mon Sep 17 00:00:00 2001 From: turegjorup Date: Tue, 29 Jul 2025 10:55:50 +0200 Subject: [PATCH 2/6] yaml lint --- templates/drupal-11/.github/workflows/build_release.yml | 4 ++-- templates/symfony-6/.github/workflows/build_release.yml | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/templates/drupal-11/.github/workflows/build_release.yml b/templates/drupal-11/.github/workflows/build_release.yml index 45f52fb..a75ab4c 100644 --- a/templates/drupal-11/.github/workflows/build_release.yml +++ b/templates/drupal-11/.github/workflows/build_release.yml @@ -1,7 +1,7 @@ on: push: tags: - - '*.*.*' + - "*.*.*" name: Create Github Release @@ -45,4 +45,4 @@ jobs: run: gh release create ${{ github.ref_name }} --verify-tag --generate-notes ../assets/*.* env: GITHUB_TOKEN: ${{ github.TOKEN }} - shell: bash \ No newline at end of file + shell: bash diff --git a/templates/symfony-6/.github/workflows/build_release.yml b/templates/symfony-6/.github/workflows/build_release.yml index 7ec26ba..f3881b1 100644 --- a/templates/symfony-6/.github/workflows/build_release.yml +++ b/templates/symfony-6/.github/workflows/build_release.yml @@ -1,7 +1,7 @@ on: push: tags: - - '*.*.*' + - "*.*.*" name: Create Github Release @@ -45,4 +45,4 @@ jobs: run: gh release create ${{ github.ref_name }} --verify-tag --generate-notes ../assets/*.* env: GITHUB_TOKEN: ${{ github.TOKEN }} - shell: bash \ No newline at end of file + shell: bash From 9ee35eaaa994010bf8a358a9968b9cc24cdc1caa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ture=20Gj=C3=B8rup?= Date: Wed, 13 Aug 2025 14:46:26 +0200 Subject: [PATCH 3/6] Update templates/drupal-11/.github/workflows/build_release.yml Co-authored-by: Mikkel Ricky --- templates/drupal-11/.github/workflows/build_release.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/templates/drupal-11/.github/workflows/build_release.yml b/templates/drupal-11/.github/workflows/build_release.yml index a75ab4c..eed47a2 100644 --- a/templates/drupal-11/.github/workflows/build_release.yml +++ b/templates/drupal-11/.github/workflows/build_release.yml @@ -24,7 +24,7 @@ jobs: - name: Composer install run: | docker network create frontend - docker compose run --rm --user=root phpfpm composer install --no-dev -o --classmap-authoritative + docker compose run --rm --user=root phpfpm composer install --no-dev --classmap-authoritative docker compose run --rm --user=root phpfpm composer clear-cache - name: Make assets dir From e99ef113fd3e490eba3ad11c0c35316341c7d486 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ture=20Gj=C3=B8rup?= Date: Wed, 13 Aug 2025 14:46:45 +0200 Subject: [PATCH 4/6] Update templates/drupal-11/.github/workflows/build_release.yml Co-authored-by: Mikkel Ricky --- templates/drupal-11/.github/workflows/build_release.yml | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/templates/drupal-11/.github/workflows/build_release.yml b/templates/drupal-11/.github/workflows/build_release.yml index eed47a2..2903476 100644 --- a/templates/drupal-11/.github/workflows/build_release.yml +++ b/templates/drupal-11/.github/workflows/build_release.yml @@ -26,7 +26,13 @@ jobs: docker network create frontend docker compose run --rm --user=root phpfpm composer install --no-dev --classmap-authoritative docker compose run --rm --user=root phpfpm composer clear-cache - + - name: Build additional assets + # Build any additional assets here + run: | + # docker compose run --rm node npm --prefix /app/web/themes/custom/site-theme install + # docker compose run --rm node npm --prefix /app/web/themes/custom/site-theme run build + # docker compose run --rm node rm -fr /app/web/themes/custom/site-theme/node_modules + - name: Make assets dir run: | mkdir -p ../assets From 6cae07ef3e6fdad1e18f55932c794b6fec4e8ff4 Mon Sep 17 00:00:00 2001 From: turegjorup Date: Wed, 13 Aug 2025 15:27:21 +0200 Subject: [PATCH 5/6] Remove redundant env values. Don't run as root --- templates/drupal-11/.github/workflows/build_release.yml | 7 ++----- templates/symfony-6/.github/workflows/build_release.yml | 7 ++----- 2 files changed, 4 insertions(+), 10 deletions(-) diff --git a/templates/drupal-11/.github/workflows/build_release.yml b/templates/drupal-11/.github/workflows/build_release.yml index 2903476..7fd5ff2 100644 --- a/templates/drupal-11/.github/workflows/build_release.yml +++ b/templates/drupal-11/.github/workflows/build_release.yml @@ -14,9 +14,6 @@ env: jobs: create-release: runs-on: ubuntu-latest - env: - COMPOSER_ALLOW_SUPERUSER: 1 - APP_ENV: prod steps: - name: Checkout uses: actions/checkout@v4 @@ -24,8 +21,8 @@ jobs: - name: Composer install run: | docker network create frontend - docker compose run --rm --user=root phpfpm composer install --no-dev --classmap-authoritative - docker compose run --rm --user=root phpfpm composer clear-cache + docker compose run --rm phpfpm composer install --no-dev --classmap-authoritative + docker compose run --rm phpfpm composer clear-cache - name: Build additional assets # Build any additional assets here run: | diff --git a/templates/symfony-6/.github/workflows/build_release.yml b/templates/symfony-6/.github/workflows/build_release.yml index f3881b1..0719809 100644 --- a/templates/symfony-6/.github/workflows/build_release.yml +++ b/templates/symfony-6/.github/workflows/build_release.yml @@ -14,9 +14,6 @@ env: jobs: create-release: runs-on: ubuntu-latest - env: - COMPOSER_ALLOW_SUPERUSER: 1 - APP_ENV: prod steps: - name: Checkout uses: actions/checkout@v4 @@ -24,8 +21,8 @@ jobs: - name: Composer install run: | docker network create frontend - docker compose run --rm --user=root -e APP_ENV=prod phpfpm composer install --no-dev --optimize-autoloader - docker compose run --rm --user=root -e APP_ENV=prod phpfpm composer clear-cache + docker compose run --rm -e APP_ENV=prod phpfpm composer install --no-dev --optimize-autoloader + docker compose run --rm -e APP_ENV=prod phpfpm composer clear-cache - name: Make assets dir run: | From 7647dcd505f2766f67c1ca5623befa6b01e23256 Mon Sep 17 00:00:00 2001 From: turegjorup Date: Wed, 13 Aug 2025 15:29:59 +0200 Subject: [PATCH 6/6] yaml lint --- templates/drupal-11/.github/workflows/build_release.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/templates/drupal-11/.github/workflows/build_release.yml b/templates/drupal-11/.github/workflows/build_release.yml index 7fd5ff2..f430a72 100644 --- a/templates/drupal-11/.github/workflows/build_release.yml +++ b/templates/drupal-11/.github/workflows/build_release.yml @@ -29,7 +29,7 @@ jobs: # docker compose run --rm node npm --prefix /app/web/themes/custom/site-theme install # docker compose run --rm node npm --prefix /app/web/themes/custom/site-theme run build # docker compose run --rm node rm -fr /app/web/themes/custom/site-theme/node_modules - + - name: Make assets dir run: | mkdir -p ../assets