Skip to content

Nightly Build

Nightly Build #555

# This workflow aim to create nightly builds on active branches
name: Nightly Build
on:
schedule:
- cron: '0 0 * * *'
workflow_dispatch:
permissions:
contents: read
jobs:
nightly-build:
name: Nightly Build
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
BRANCH:
- develop
- 8.2.x
- 8.1.x
- 8.0.x
- 1.7.8.x
include:
- BRANCH: develop
node: 16
- BRANCH: 8.2.x
node: 16
- BRANCH: 8.1.x
node: 16
- BRANCH: 8.0.x
node: 14
- BRANCH: 1.7.8.x
node: 14
env:
PHP_VERSION: '7.4'
NODE_VERSION: ${{ matrix.node }}
RELEASE_DIR: '/tmp/ps-release'
GH_BRANCH: ${{ matrix.BRANCH }}
GC_PROJECT_ID: ${{ secrets.GC_PROJECT_ID }}
GC_SERVICE_KEY: ${{ secrets.GC_SERVICE_KEY }}
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
ref: ${{ env.GH_BRANCH }}
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ env.PHP_VERSION }}
extensions: mbstring, intl, gd, xml, dom, json, fileinfo, curl, zip, iconv
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: ${{ env.NODE_VERSION }}
- name: Create Release directory
run: mkdir -p ${{ env.RELEASE_DIR }}
- name: Create build
run: php tools/build/CreateRelease.php --destination-dir=${{ env.RELEASE_DIR }}
- name: Rename build
run: today=`date +%Y-%m-%d`; for i in *; do mv $i $today-$GH_BRANCH-$i; done
working-directory: ${{ env.RELEASE_DIR }}
- name: Create nightly.zip for develop
if: env.GH_BRANCH == 'develop'
run: |
today=`date +%Y-%m-%d`
cp $today-$GH_BRANCH*.zip nightly.zip
working-directory: ${{ env.RELEASE_DIR }}
- name: Auth Cloud Sdk
uses: google-github-actions/auth@v1
with:
credentials_json: ${{ env.GC_SERVICE_KEY }}
project_id: ${{ env.GC_PROJECT_ID }}
- name: Setup Cloud Sdk
uses: google-github-actions/setup-gcloud@v1
- name: Delete last Nightly zip from develop
if: env.GH_BRANCH == 'develop'
run: gsutil rm -rf gs://prestashop-core-nightly/nightly.zip
- name: Upload to Google Cloud Storage (GCS)
if: always()
run: gsutil cp -r "${{ env.RELEASE_DIR }}/**" gs://prestashop-core-nightly