-
Notifications
You must be signed in to change notification settings - Fork 24
87 lines (86 loc) · 3.32 KB
/
purejs_deploy_release_and_prerelease.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
name: <Pure JS> Publish JS files
on:
release:
types: [released, prereleased]
jobs:
publish:
runs-on: ubuntu-latest
env:
CORE_PACKAGE_DIR: "./packages/mapray"
UI_PACKAGE_DIR: "./packages/ui"
DEPLOY_DIR: "./_deploy"
CORE_DEPLOY_DIR: "./_deploy/public/mapray-js"
UI_DEPLOY_DIR: "./_deploy/public/ui"
EMSDK_DIR: "./_deploy/emsdk"
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: 18
- id: 'gcp-auth'
uses: 'google-github-actions/auth@v1'
with:
credentials_json: ${{ secrets.STORE_CREDENTIALS }}
- name: Setup EMSDK
run: |
mkdir -p ${{ env.EMSDK_DIR }}/../
echo "Cloning EMSDK from github"
git clone --branch=2.0.9 --depth=1 https://github.com/emscripten-core/emsdk.git ${{ env.EMSDK_DIR }}
echo "Coping patch file to the EMSDK directory"
cp ${{ env.CORE_PACKAGE_DIR }}/wasm/emsdk.patch ${{ env.EMSDK_DIR }}/emsdk.patch
echo "Install and Activate EMSDK"
cd ${{ env.EMSDK_DIR }}
./emsdk install latest
./emsdk activate latest
echo "Apply the patch to EMSDK"
git apply -p1 emsdk.patch
- run: git fetch --prune --unshallow
- name: Get deploy version
run: |
NEXT_VERSION=$(echo ${{ github.ref }} | sed -e "s#refs/tags/##g")
echo ${NEXT_VERSION}
echo "::set-output name=next_version::${NEXT_VERSION}"
id: get_version
shell: bash
working-directory: ${{ env.CORE_PACKAGE_DIR }}
- name: Build wasm code
run: |
echo "Activate EMSDK"
source ${{ env.EMSDK_DIR }}/emsdk_env.sh
echo "Build wasm code"
cd ${{ env.CORE_PACKAGE_DIR }}
./wasm/rebuild_and_install.sh
shell: bash
- name: Setup
run: yarn install
- name: Build maprayJS
run: yarn build
- name: Copy core built files to dist directory
run: |
mkdir -p ${{ env.CORE_DEPLOY_DIR }}/v${{ steps.get_version.outputs.next_version }}
cp -r ${{ env.CORE_PACKAGE_DIR }}/dist/umd/* ${{ env.CORE_DEPLOY_DIR }}/v${{ steps.get_version.outputs.next_version }}
- name: Copy ui built files to dist directory
run: |
mkdir -p ${{ env.UI_DEPLOY_DIR }}/v${{ steps.get_version.outputs.next_version }}
mkdir -p ${{ env.DEPLOY_DIR }}/public/styles/v1
cp -r ${{ env.UI_PACKAGE_DIR }}/dist/umd/* ${{ env.UI_DEPLOY_DIR }}/v${{ steps.get_version.outputs.next_version }}
cp -r ${{ env.UI_PACKAGE_DIR }}/dist/mapray.css ${{ env.DEPLOY_DIR }}/public/styles/v1/
shell: bash
- name: Upload core files
uses: google-github-actions/upload-cloud-storage@v1
with:
path: ${{ env.CORE_DEPLOY_DIR }}
destination: inou-pro-released/mapray-js
parent: false
- name: Upload ui files
uses: google-github-actions/upload-cloud-storage@v1
with:
path: ${{ env.UI_DEPLOY_DIR }}
destination: inou-pro-released/ui
parent: false
- name: Upload style sheet
uses: google-github-actions/upload-cloud-storage@v1
with:
path: ${{ env.DEPLOY_DIR }}/public/styles
destination: inou-pro-released/styles
parent: false