Skip to content

Commit

Permalink
Use temporary directory for zipped files
Browse files Browse the repository at this point in the history
Avoid zipping a directory where the output is also the input.
  • Loading branch information
justin-robertson-git committed Oct 30, 2024
1 parent 2295c26 commit a36788e
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions .github/workflows/create-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,34 +33,34 @@ jobs:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Zip the entire repository directory
run: zip -r source-${{ env.TAG_NAME }}.zip .
run: zip -r ${{ runner.temp }}/source-${{ env.TAG_NAME }}.zip . -x .git/\* .github/\* .gitignore

- name: Tar the entire repository directory
run: tar -czvf source-${{ env.TAG_NAME }}.tar.gz .
run: tar -czvf ${{ runner.temp }}/source-${{ env.TAG_NAME }}.tar.gz --exclude=.git --exclude=.github .

- name: Zip the Api directory
run: zip -r Auctane_Api-${{ env.TAG_NAME }}.zip Api
run: zip -r ${{ runner.temp }}/Auctane_Api-${{ env.TAG_NAME }}.zip Api

- name: Upload source zip file
uses: actions/upload-release-asset@v1
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./source-${{ env.TAG_NAME }}.zip
asset_path: ${{ runner.temp }}/source-${{ env.TAG_NAME }}.zip
asset_name: source-${{ env.TAG_NAME }}.zip
asset_content_type: application/zip

- name: Upload source tar.gz file
uses: actions/upload-release-asset@v1
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./source-${{ env.TAG_NAME }}.tar.gz
asset_path: ${{ runner.temp }}/source-${{ env.TAG_NAME }}.tar.gz
asset_name: source-${{ env.TAG_NAME }}.tar.gz
asset_content_type: application/gzip

- name: Upload Api zip file
uses: actions/upload-release-asset@v1
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./Auctane_Api-${{ env.TAG_NAME }}.zip
asset_path: ${{ runner.temp }}/Auctane_Api-${{ env.TAG_NAME }}.zip
asset_name: Auctane_Api-${{ env.TAG_NAME }}.zip
asset_content_type: application/zip

0 comments on commit a36788e

Please sign in to comment.