Skip to content

Nightly Build

Nightly Build #589

# This workflow aim to create nightly builds on active branches
name: Nightly Build
on:
schedule:
- cron: '0 1 * * *'
workflow_dispatch:
permissions:
contents: read
jobs:
nightly-build:
name: Nightly Build
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
BRANCH:
- develop
- 8.1.x
- 8.0.x
- 1.7.8.x
include:
- BRANCH: develop
node: 16
- BRANCH: 8.1.x
node: 16
- BRANCH: 8.0.x
node: 16
- 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@v3
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@v3
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: Auth Cloud Sdk
uses: google-github-actions/auth@v0
with:
credentials_json: ${{ env.GC_SERVICE_KEY }}
project_id: ${{ env.GC_PROJECT_ID }}
- name: Setup Cloud Sdk
uses: google-github-actions/setup-gcloud@v0
- name: Upload to Google Cloud Storage (GCS)
run: gsutil cp -r "${{ env.RELEASE_DIR }}/**" gs://prestashop-core-nightly