-
Notifications
You must be signed in to change notification settings - Fork 33
174 lines (147 loc) · 6.93 KB
/
build-new-release.yaml
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
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
name: Build TizenBrew Standalone Application and Release
on:
push:
tags:
- 'v*.*.*'
env:
TIZEN_STUDIO_VER: 5.6
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Clone repo
uses: actions/checkout@v3
- name: Set env
run: echo "RELEASE_VERSION=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV
- name: Install modules and transpile service
working-directory: tizenbrew-app/TizenBrew/service
run: |
sudo apt install -y expect zip coreutils
sudo curl -Lo /usr/bin/ldid https://github.com/ProcursusTeam/ldid/releases/download/v2.1.5-procursus7/ldid_linux_x86_64
sudo chmod a+rwx /usr/bin/ldid
npm install
npm install -g @vercel/ncc wgt-to-usb pkg
npx babel . --out-dir transpiled --copy-files
rm -r node_modules
- name: Build service
working-directory: tizenbrew-app/TizenBrew/service/transpiled
run: |
ncc build service.js -o ../dist
rm -r node_modules
- name: Clean up transpiled files
working-directory: tizenbrew-app/TizenBrew/service
run: |
rm -r transpiled
- name: Install modules and build updater service
working-directory: tizenbrew-updater/TizenBrewUpdater/service
run: |
npm install
ncc build service.js
rm -r node_modules
- name: Download Tizen-Studio
run: |
curl -o tizen-installer "https://download.tizen.org/sdk/Installer/tizen-studio_${TIZEN_STUDIO_VER}/web-cli_Tizen_Studio_${TIZEN_STUDIO_VER}_ubuntu-64.bin"
- name: Install Tizen-Studio
run: |
chmod +x tizen-installer
./tizen-installer --accept-license "${GITHUB_WORKSPACE}/tizen-studio"
rm ./tizen-installer
echo 'export PATH=$PATH:${GITHUB_WORKSPACE}/tizen-studio/tools/ide/bin' >> .bashrc
- name: Prepare Tizen Certificate
run: |
mkdir -p "${GITHUB_WORKSPACE}/tizen-studio-data/keystore/author/"
echo "${{ secrets.TIZEN_AUTHOR_KEY }}" | base64 -d > "${GITHUB_WORKSPACE}/tizen-studio-data/keystore/author/tizenbrew-author.p12"
./tizen-studio/tools/ide/bin/tizen cli-config "profiles.path=${GITHUB_WORKSPACE}/tizen-studio-data/profile/profiles.xml"
cp .github/assets/profiles.xml "${GITHUB_WORKSPACE}/tizen-studio-data/profile/profiles.xml"
sed -i "s|\$GITHUB_WORKSPACE|${GITHUB_WORKSPACE}|g" "${GITHUB_WORKSPACE}/tizen-studio-data/profile/profiles.xml"
sed -i "s|\$KEY_PW|${{ secrets.TIZEN_AUTHOR_KEY_PW }}|g" "${GITHUB_WORKSPACE}/tizen-studio-data/profile/profiles.xml"
chmod 755 "./tizen-studio-data/profile/profiles.xml"
- name: Build TizenBrew
working-directory: tizenbrew-app/TizenBrew
run: |
${GITHUB_WORKSPACE}/tizen-studio/tools/ide/bin/tizen build-web -e ".*" -e "node_modules/*" -e "package*.json" -e "yarn.lock"
- name: Build TizenBrew Updater
working-directory: tizenbrew-updater/TizenBrewUpdater
run: |
${GITHUB_WORKSPACE}/tizen-studio/tools/ide/bin/tizen build-web -e ".*" -e "node_modules/*" -e "package*.json" -e "yarn.lock"
- name: Package TizenBrew for Old Tizen
env:
PASSWORD: ${{ secrets.TIZEN_AUTHOR_KEY_PW }}
APP_PATH: tizenbrew-app/TizenBrew
CERT: TizenBrew-Old
run: |
expect ./package.exp
cat "${GITHUB_WORKSPACE}/tizen-studio-data/cli/logs/cli.log"
mv tizenbrew-app/TizenBrew/release/TizenBrewStandalone.wgt tizenbrew-app/TizenBrew/release/TizenBrewStandalone-Old.wgt
- name: Package TizenBrew for New Tizen
env:
PASSWORD: ${{ secrets.TIZEN_AUTHOR_KEY_PW }}
APP_PATH: tizenbrew-app/TizenBrew
CERT: TizenBrew-New
run: |
expect ./package.exp
mv tizenbrew-app/TizenBrew/release/TizenBrewStandalone.wgt tizenbrew-app/TizenBrew/release/TizenBrewStandalone-New.wgt
- name: Package TizenBrew Updater for Old Tizen
env:
PASSWORD: ${{ secrets.TIZEN_AUTHOR_KEY_PW }}
APP_PATH: tizenbrew-updater/TizenBrewUpdater
CERT: TizenBrew-Old
run: |
expect ./package.exp
mv "tizenbrew-updater/TizenBrewUpdater/release/TizenBrew Updater.wgt" tizenbrew-updater/TizenBrewUpdater/release/TizenBrewUpdater-Old.wgt
- name: Package TizenBrew Updater for New Tizen
env:
PASSWORD: ${{ secrets.TIZEN_AUTHOR_KEY_PW }}
APP_PATH: tizenbrew-updater/TizenBrewUpdater
CERT: TizenBrew-New
run: |
expect ./package.exp
mv "tizenbrew-updater/TizenBrewUpdater/release/TizenBrew Updater.wgt" tizenbrew-updater/TizenBrewUpdater/release/TizenBrewUpdater-New.wgt
- name: Package TizenBrew as USB Demo Package
working-directory: tizenbrew-app/TizenBrew
run: |
wgt-to-usb release/TizenBrewStandalone-Old.wgt
- name: Package Updater as USB Demo Package
working-directory: tizenbrew-updater/TizenBrewUpdater
run: |
wgt-to-usb release/TizenBrewUpdater-Old.wgt
- name: Package Updater for Desktop
working-directory: tizenbrew-updater/TizenBrewUpdater
run: |
pkg -C GZip . --no-bytecode --public
- name: Upload TizenBrew package artifact for Old Tizen
uses: actions/upload-artifact@v2
with:
name: app-${{ github.sha }}-old.wgt
path: tizenbrew-app/TizenBrew/release/TizenBrewStandalone-Old.wgt
- name: Upload TizenBrew package artifact for New Tizen
uses: actions/upload-artifact@v2
with:
name: app-${{ github.sha }}-new.wgt
path: tizenbrew-app/TizenBrew/release/TizenBrewStandalone-New.wgt
- name: Upload TizenBrew Updater package artifact for Old Tizen
uses: actions/upload-artifact@v2
with:
name: updater-${{ github.sha }}-old.wgt
path: tizenbrew-updater/TizenBrewUpdater/release/TizenBrewUpdater-Old.wgt
- name: Upload TizenBrew Updater package artifact for New Tizen
uses: actions/upload-artifact@v2
with:
name: updater-${{ github.sha }}-new.wgt
path: tizenbrew-updater/TizenBrewUpdater/release/TizenBrewUpdater-New.wgt
- name: Zip USB Demo Package
working-directory: tizenbrew-app/TizenBrew
run: |
zip -r release/TizenBrewStandaloneUSBDemo.zip userwidget/
- name: Zip Updater USB Demo Package
working-directory: tizenbrew-updater/TizenBrewUpdater
run: |
zip -r release/TizenBrewUpdaterUSBDemo.zip userwidget/
- name: Release TizenBrew Build Results
uses: softprops/action-gh-release@v1
with:
tag_name: ${{ env.RELEASE_VERSION }}
files: |
tizenbrew-app/TizenBrew/release/*
tizenbrew-updater/TizenBrewUpdater/release/*
tizenbrew-updater/TizenBrewUpdater/dist/*