Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GitHub workflow ps6 - fix draft release #1292

Merged
merged 7 commits into from
Dec 4, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 @@ -27,7 +27,7 @@ jobs:
environment: ${{ inputs.env-lower }}
permissions:
id-token: write
contents: read
contents: write
pull-requests: write
if: inputs.triggered == true

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/[email protected]
env:
Expand Down
Loading