forked from PrestaShop/PrestaShop
-
Notifications
You must be signed in to change notification settings - Fork 0
86 lines (70 loc) · 2.16 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
# 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: Setup NPM
run: npm install -g npm@7
- 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