From d9193d2abdf0fc72d5be9b048c19307217c3db18 Mon Sep 17 00:00:00 2001 From: Scott Date: Wed, 13 Dec 2023 13:09:18 -0500 Subject: [PATCH] Add create archive step to CD workflow (#280) * add .python-version to gitignore * rsync and distignore * ls -al * zip step and add artifact to release * comments and README.md to distignore --- .distignore | 16 ++++++++++++++++ .github/workflows/continuous_deployment.yml | 11 +++++++++++ .gitignore | 3 +++ 3 files changed, 30 insertions(+) create mode 100644 .distignore diff --git a/.distignore b/.distignore new file mode 100644 index 0000000..72bf60b --- /dev/null +++ b/.distignore @@ -0,0 +1,16 @@ +/docs +.changelogger* +.dev +.DS_Store +.git +.github +.gitignore +.idea +.phpunit.* +.phpcs.* +.python-version +.pre-commit-config.yaml +CHANGELOG.md +README.md +makefile +.distignore diff --git a/.github/workflows/continuous_deployment.yml b/.github/workflows/continuous_deployment.yml index dcede8d..e4238bf 100644 --- a/.github/workflows/continuous_deployment.yml +++ b/.github/workflows/continuous_deployment.yml @@ -32,6 +32,8 @@ jobs: runs-on: ubuntu-latest needs: determine-if-deploy if: needs.determine-if-deploy.outputs.deploy == 'true' + env: + ZIP_FILE_NAME: klaviyo_reclaim-${{ needs.determine-if-deploy.outputs.version }}.zip steps: - uses: actions/checkout@v3 - name: Setup Python 3.11 @@ -53,7 +55,15 @@ jobs: changelogger notes $VERSION --no-pretty >> $GITHUB_ENV echo ${DELIMITER} >> $GITHUB_ENV + - name: Create Archive + # Create zip archive for release to composer repository (Packagist) + run: | + wrapper_dir="magento2-klaviyo" + rsync -rc --exclude-from=".distignore" "$GITHUB_WORKSPACE/" $wrapper_dir/ --delete --delete-excluded + zip -r ${{ env.ZIP_FILE_NAME }} ./$wrapper_dir + - name: Create GitHub Tag & Release + # Creates GH tag and release, adds zip archive as artifact to release. uses: ncipollo/release-action@v1 with: tag: ${{ needs.determine-if-deploy.outputs.version }} @@ -61,6 +71,7 @@ jobs: name: Release ${{ needs.determine-if-deploy.outputs.version }} body: ${{ env.content }} prerelease: true + artifacts: ${{ env.ZIP_FILE_NAME }} - name: Send PagerDuty alert on failure if: ${{ failure() }} diff --git a/.gitignore b/.gitignore index 11ef3f5..11eb30f 100644 --- a/.gitignore +++ b/.gitignore @@ -206,3 +206,6 @@ fabric.properties /build/ # End of https://www.toptal.com/developers/gitignore/api/phpunit,php-cs-fixer,phpcodesniffer,phpstorm,phpstorm+all + +# pyenv +.python-version