Skip to content

Commit

Permalink
update GitHub action for release zip
Browse files Browse the repository at this point in the history
  • Loading branch information
threadi committed Dec 13, 2024
1 parent c6803ad commit 5e2ef5b
Showing 1 changed file with 11 additions and 16 deletions.
27 changes: 11 additions & 16 deletions .github/workflows/build-zip.yml
Original file line number Diff line number Diff line change
Expand Up @@ -71,21 +71,16 @@ jobs:
- name: Generate autoloader
run: composer dump-autoload -oa --no-dev

- name: Generate translation files
run: |
wp i18n make-json languages --no-purge
wp i18n make-php languages
- name: Run WordPress Coding Standard fixes
run: vendor/bin/phpcbf --extensions=php --ignore=*/vendor/*,*/node_modules/*,*/blocks/*,*/svn/*,*/legacy-classes/Divi/node_modules/*,*/inc/applications/texts.php,*/app/PersonioIntegration/Multilingual/TranslatePress.php,*/deprecated/*,*/languages/*,*/inc/constants_urls.php --standard=ruleset.xml .
run: vendor/bin/phpcbf --extensions=php --ignore=*/vendor/*,*/build/*,*/node_modules/*,*/blocks/*,*/svn/*,*/example/*,*/deprecated/* --standard=ruleset.xml .

- name: Run WordPress Coding Standard checks
run: vendor/bin/phpcs --extensions=php --ignore=*/vendor/*,*/node_modules/*,*/blocks/*,*/svn/*,*/legacy-classes/Divi/node_modules/*,*/inc/applications/texts.php,*/app/PersonioIntegration/Multilingual/TranslatePress.php,*/deprecated/*,*/languages/*,*/inc/constants_urls.php --standard=ruleset.xml .
run: vendor/bin/phpcs --extensions=php --ignore=*/vendor/*,*/build/*,*/node_modules/*,*/blocks/*,*/svn/*,*/example/*,*/deprecated/* --standard=ruleset.xml .

- name: Set version number 1
uses: richardrigutins/replace-in-files@v2
with:
files: 'personio-integration.php'
files: 'personio-integration-light.php'
search-text: '@@VersionNumber@@'
replacement-text: ${{ github.ref_name }}

Expand All @@ -106,18 +101,18 @@ jobs:
- name: Create ZIP release
run: |
cd ..
mv ${{ github.event.repository.name }} personio-integration
zip -r -q personio-integration_${{ github.ref_name }}.zip personio-integration/* -x "*/.git/*" "*/.github/*" "*/blocks/*/src/*" "*/doc/*" "*/inc/constants_urls.php.dist" "*/inc/applications/texts.php" "*/legacy-classes/Divi/.yarn/*" "*/legacy-classes/Divi/node_modules/*" "*/legacy-classes/Divi/.env" "*/legacy-classes/Divi/.yarnrc" "*/legacy-classes/Divi/yarn.lock" "*/legacy-classes/Divi/package.json" "*/legacy-classes/Divi/*/.gitkeep" "*/phpcs.xml" "*/composer.json" "*/composer.lock" "*/package.json" "*/package-lock.json" "*/readme.md" "*/ruleset.xml" "*/todo.txt" "/build/*" "/releases/*" "*/.gitignore" "/vendor/*" "*/node_modules/*" "/.editorconfig"
zip -ur personio-integration_${{ github.ref_name }}.zip personio-integration/vendor/autoload.php
zip -ur personio-integration_${{ github.ref_name }}.zip personio-integration/vendor/composer/*
zip -ur personio-integration_${{ github.ref_name }}.zip personio-integration/vendor/threadi/*/build/*
mv personio-integration ${{ github.event.repository.name }}
cp personio-integration_${{ github.ref_name }}.zip ${{ github.event.repository.name }}/
mv ${{ github.event.repository.name }} personio-integration-light
zip -r -q personio-integration-light_${{ github.ref_name }}.zip personio-integration-light/* -x "*/.git/*" "*/.github/*" "*/blocks/*/src/*" "*/doc/*" "*/legacy-classes/Divi/.yarn/*" "*/phpcs.xml" "*/composer.json" "*/composer.lock" "*/package.json" "*/package-lock.json" "*/readme.md" "*/ruleset.xml" "*/todo.txt" "build/*" "releases/*" "*/.gitignore" "*/vendor/*" "*/node_modules/*" "/.editorconfig"
zip -ur personio-integration-light_${{ github.ref_name }}.zip personio-integration-light/vendor/autoload.php
zip -ur personio-integration-light_${{ github.ref_name }}.zip personio-integration-light/vendor/composer/*
zip -ur personio-integration-light_${{ github.ref_name }}.zip personio-integration-light/vendor/threadi/*/build/*
mv personio-integration-light ${{ github.event.repository.name }}
cp personio-integration-light_${{ github.ref_name }}.zip ${{ github.event.repository.name }}/
- name: Create Release
uses: softprops/action-gh-release@v2
if: startsWith(github.ref, 'refs/tags/')
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
files: personio-integration_${{ github.ref_name }}.zip
files: personio-integration-light${{ github.ref_name }}.zip

0 comments on commit 5e2ef5b

Please sign in to comment.