Skip to content

Commit

Permalink
Add create archive step to CD workflow (#280)
Browse files Browse the repository at this point in the history
* add .python-version to gitignore

* rsync and distignore

* ls -al

* zip step and add artifact to release

* comments and README.md to distignore
  • Loading branch information
smoucka authored Dec 13, 2023
1 parent d52e176 commit d9193d2
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 0 deletions.
16 changes: 16 additions & 0 deletions .distignore
Original file line number Diff line number Diff line change
@@ -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
11 changes: 11 additions & 0 deletions .github/workflows/continuous_deployment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -53,14 +55,23 @@ 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 }}
commit: ${{ github.sha }}
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() }}
Expand Down
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit d9193d2

Please sign in to comment.