Skip to content

Commit

Permalink
Fix release draft
Browse files Browse the repository at this point in the history
  • Loading branch information
seiwan committed Dec 3, 2024
1 parent c7d306a commit 896720e
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 24 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,14 +22,14 @@ jobs:
outputs:
integration: ${{ steps.zip-name.outputs.integration }}
preproduction: ${{ steps.zip-name.outputs.preproduction }}
production: ${{ github.event.repository.name }}
production: ${{ github.event.repository.name }}.zip

steps:
- name: Generate zip file name
id: zip-name
run: |
date=$(date -d '+2 hours' +'%Y-%m-%d_%H-%M-%S')
echo "$ENV=$REPOSITORY-$PS_VERSION-$ENV-$PR_NUMBER-$date" >> "$GITHUB_OUTPUT"
echo "$ENV=$REPOSITORY-$PS_VERSION-$ENV-$PR_NUMBER-$date.zip" >> "$GITHUB_OUTPUT"
env:
ENV: ${{ matrix.env }}
REPOSITORY: ${{ github.event.repository.name }}
Expand Down
14 changes: 7 additions & 7 deletions .github/workflows/push-to-bucket.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,24 +28,24 @@ on:

jobs:
bucket-zip-name:
name: Generate zip file name
name: Generate zip file name for GCP bucket
runs-on: ubuntu-latest
outputs:
integration: ${{ inputs.zip-name }}.zip
preproduction: ${{ inputs.zip-name }}.zip
production: ${{ steps.zip-name.outputs.name }}.zip
integration: ${{ inputs.zip-name }}
preproduction: ${{ inputs.zip-name }}
production: ${{ steps.zip-name.outputs.name }}

steps:
- name: Generate zip file name
id: zip-name
run: |
date=$(date -d '+2 hours' +'%Y-%m-%d_%H-%M-%S')
echo "name=$REPOSITORY-$PS_VERSION-$ENV-$PR_NUMBER-$date" >> "$GITHUB_OUTPUT"
echo "name=$REPOSITORY-$PS_VERSION-$ENV-$PR_NUMBER-$date.zip" >> "$GITHUB_OUTPUT"
env:
ENV: production
REPOSITORY: ${{ inputs.repository-name }}
PS_VERSION: ${{ inputs.prestashop-version }}
PR_NUMBER: pr${{ inputs.pr-number }}
PR_NUMBER: ${{ inputs.pr-number }}

push-to-bucket:
name: ${{ inputs.env-upper }} - Create zip file and push to GCP bucket storage
Expand All @@ -54,7 +54,7 @@ jobs:
environment: ${{ inputs.env-lower }}
permissions:
id-token: write
contents: read
contents: write
pull-requests: write
if: inputs.triggered == true

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/push-to-repository.yml
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ jobs:
- name: Create & upload artifact 🛩️
uses: actions/upload-artifact@v4
with:
name: ${{ inputs.zip-name }}.zip
name: ${{ inputs.zip-name }}
path: ${{ steps.artifacts.outputs.path }}
include-hidden-files: true
retention-days: ${{ (inputs.env-lower == 'production' && 90) || 1 }}
Expand Down
16 changes: 2 additions & 14 deletions .github/workflows/update-release-draft.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:
environment: ${{ inputs.env-lower }}
permissions:
id-token: write
contents: read
contents: write
pull-requests: write
if: inputs.triggered == true
env:
Expand All @@ -39,25 +39,13 @@ jobs:
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
commitish: prestashop/1.7.x
commitish: prestashop/1.6.x

- name: Prepare zip for release 👷
run: |
cd ${{ inputs.repository-name }}
zip -r ../${{ env.ZIP_NAME }} . -x '*.DS_Store*' '*.git*' '*/.php_cs.*' '*__MACOSX*' '*/node_modules' '*/.npmrc' '*/composer.*' '*/package.*' '*/.editorconfig' '*_dev*' '*test*' '*/tests/*' '*/Test/*' '*/Tests/*' '*/gha-creds-*.json'
- name: Clean existing assets ♻️
shell: bash
run: |
curl -fsSL https://github.com/github/hub/raw/master/script/get | bash -s 2.14.1
assets=`bin/hub api -t repos/${{ inputs.repository-name }}/releases/${{ steps.release_info.outputs.id }}/assets | awk '/\].url/ { print $2 }'`
for asset in $assets
do
bin/hub api -X DELETE $asset
done
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Publish to GitHub Release 🛩️
uses: actions/upload-release-asset@v1.0.2
env:
Expand Down

0 comments on commit 896720e

Please sign in to comment.