forked from PrestaShop/PrestaShop
-
Notifications
You must be signed in to change notification settings - Fork 0
101 lines (84 loc) · 2.63 KB
/
cron_nightly_build.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
# 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
- 9.0.x
- 8.2.x
- 8.1.x
- 8.0.x
- 1.7.8.x
include:
- BRANCH: develop
node: 20
- BRANCH: 9.0.x
node: 20
- 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