Skip to content

v2.3.0

v2.3.0 #119

name: Release and publish
on:
release:
types: [released, prereleased]
jobs:
build:
name: Build the base artifact
runs-on: ubuntu-latest
if: github.event.release.draft == false
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Install composer dependencies
run: composer install --no-dev -o
- name: Bump version
run: make version
env:
VERSION: ${{ github.event.release.tag_name }}
- name: Create & upload artifact
uses: actions/upload-artifact@v1
with:
name: ${{ github.event.repository.name }}
path: ./
upload_release_asset_production:
name: Upload the production zip asset to the release
runs-on: ubuntu-latest
needs: [build]
steps:
- name: Download artifact
uses: actions/download-artifact@v1
with:
name: ${{ github.event.repository.name }}
- name: Bundle the production zip
run: |
cd ${{ github.event.repository.name }}
echo "$CONFIG_FILE" >> .config.prod.yml
make zip-prod
env:
CONFIG_FILE: ${{ secrets.PS_EVENTBUS_PRODUCTION_CONFIG }}
- name: Publish the production zip
uses: actions/upload-release-asset@v1.0.1
env:
GITHUB_TOKEN: ${{ secrets.GA_ACCESS_TOKEN }}
with:
upload_url: ${{ github.event.release.upload_url }}
asset_path: ./${{ github.event.repository.name }}/dist/${{ github.event.repository.name }}-${{ github.event.release.tag_name }}.zip
asset_name: ${{ github.event.repository.name }}-${{ github.event.release.tag_name }}.zip
asset_content_type: application/zip
upload_release_asset_integration:
name: Upload the integration zip asset to the release
runs-on: ubuntu-latest
needs: [build]
steps:
- name: Download artifact
uses: actions/download-artifact@v1
with:
name: ${{ github.event.repository.name }}
- name: Bundle the integration zip
run: |
cd ${{ github.event.repository.name }}
echo "$CONFIG_FILE" >> .config.inte.yml
make zip-inte
env:
CONFIG_FILE: ${{ secrets.PS_EVENTBUS_INTEGRATION_CONFIG }}
- name: Publish the integration zip
uses: actions/upload-release-asset@v1.0.1
env:
GITHUB_TOKEN: ${{ secrets.GA_ACCESS_TOKEN }}
with:
upload_url: ${{ github.event.release.upload_url }}
asset_path: ./${{ github.event.repository.name }}/dist/${{ github.event.repository.name }}-${{ github.event.release.tag_name }}_integration.zip
asset_name: ${{ github.event.repository.name }}-${{ github.event.release.tag_name }}_integration.zip
asset_content_type: application/zip
upload_release_asset_preproduction:
name: Upload the preproduction zip asset to the release
runs-on: ubuntu-latest
needs: [build]
steps:
- name: Download artifact
uses: actions/download-artifact@v1
with:
name: ${{ github.event.repository.name }}
- name: Bundle the pre-production zip
run: |
cd ${{ github.event.repository.name }}
echo "$CONFIG_FILE" >> .config.preprod.yml
make zip-preprod
env:
CONFIG_FILE: ${{ secrets.PS_EVENTBUS_PREPRODUCTION_CONFIG }}
- name: Publish the preprod zip
uses: actions/upload-release-asset@v1.0.1
env:
GITHUB_TOKEN: ${{ secrets.GA_ACCESS_TOKEN }}
with:
upload_url: ${{ github.event.release.upload_url }}
asset_path: ./${{ github.event.repository.name }}/dist/${{ github.event.repository.name }}-${{ github.event.release.tag_name }}_preproduction.zip
asset_name: ${{ github.event.repository.name }}-${{ github.event.release.tag_name }}_preproduction.zip
asset_content_type: application/zip
publish_to_marketplace:
name: Publish the module to the addons marketplace
runs-on: ubuntu-latest
needs: upload_release_asset_production
if: "!github.event.release.prerelease"
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Download release asset
uses: dsaltares/fetch-gh-release-asset@master
with:
version: tags/${{ github.event.release.tag_name }}
file: ${{ github.event.repository.name }}-${{ github.event.release.tag_name }}.zip
token: ${{ secrets.GA_ACCESS_TOKEN }}
- name: Prepare publishing tool
run: |
composer global require prestashop/publish-on-marketplace
- name: Release zip
run: |
export CHANGELOG="${CHANGELOG:=No changelog provided}"
~/.composer/vendor/bin/publish-on-marketplace \
--archive=$PWD/${{ github.event.repository.name }}-${{ github.event.release.tag_name }}.zip \
--metadata-json=$PWD/.github/mktp-metadata.json \
--changelog="$CHANGELOG" \
--api-key="${{ secrets.MARKETPLACE_API_KEY }}" \
--debug
env:
CHANGELOG: ${{ github.event.release.body }}