1- name : Notion Repackaged Main
1+ name : repackage-notion-app
22
33on :
44 push :
55 branches : [main]
66 paths :
7- - ' notion-repackaged .sh'
7+ - ' env .sh'
88 - ' .github/workflows/notion-repackaged.yml'
99
1010 workflow_dispatch :
1515
1616jobs :
1717 preload-variables :
18- name : Preload variables
18+ name : preload variables
1919 runs-on : ubuntu-latest
2020 steps :
2121 - uses : actions/checkout@v2
2222 - id : preload-variables
2323 name : Load variables and set them as outputs
2424 run : |
25- source notion-repackaged .sh
25+ source env .sh
2626
2727 echo "::set-output name=notion_version::$NOTION_VERSION"
2828 echo "::set-output name=notion_repackaged_revision::$NOTION_REPACKAGED_REVISION"
29- echo "::set-output name=notion_download_hash::$NOTION_DOWNLOAD_HASH"
30- echo "::set-output name=notion_enhancer_commit::$NOTION_ENHANCER_COMMIT"
3129
32- NOTION_REPACKAGED_VERSION_REV="${NOTION_VERSION}-${NOTION_REPACKAGED_REVISION}"
3330 echo "::set-output name=notion_repackaged_version_rev::$NOTION_REPACKAGED_VERSION_REV"
3431 outputs :
3532 notion_version : ${{ steps.preload-variables.outputs.notion_version }}
3633 notion_repackaged_revision : ${{ steps.preload-variables.outputs.notion_repackaged_revision }}
3734 notion_repackaged_version_rev : ${{ steps.preload-variables.outputs.notion_repackaged_version_rev }}
38- notion_download_hash : ${{ steps.preload-variables.outputs.notion_download_hash }}
39- notion_enhancer_commit : ${{ steps.preload-variables.outputs.notion_enhancer_commit }}
4035
4136 create-release :
42- name : Create release
37+ name : create release
4338 runs-on : ubuntu-latest
4439 needs : [preload-variables]
4540 steps :
@@ -50,62 +45,36 @@ jobs:
5045 with :
5146 version : ${{ needs.preload-variables.outputs.notion_repackaged_version_rev }}
5247
53- make-vanilla -sources :
54- name : Make vanilla sources
48+ generate -sources :
49+ name : extract and patch vanilla and enhanced sources
5550 runs-on : ubuntu-latest
56- needs : [preload-variables]
57- env :
58- NOTION_VERSION : ${{ needs.preload-variables.outputs.notion_version }}
59- NOTION_REPACKAGED_REVISION : ${{ needs.preload-variables.outputs.notion_repackaged_revision }}
51+ needs : [preload-variables, create-release]
6052 steps :
6153 - uses : actions/checkout@v2
62- - name : Download official Windows build
63- env :
64- NOTION_DOWNLOAD_HASH : ${{ needs.preload-variables.outputs.notion_download_hash }}
65- run : scripts/download-exe.sh
66- - name : Extract sources from Windows Build
67- run : scripts/extract-src.sh
68- - name : Zip sources dir with 7z
54+ - name : install build dependencies
55+ run : sudo apt install --no-install-recommends -y curl p7zip-full coreutils jq git imagemagick icnsutils
56+ - name : run build script
57+ run : ./build.sh --reset
58+ - name : zip vanilla source dir with 7z
6959 working-directory : build
7060 run : 7z a vanilla-src.zip vanilla-src
71- - name : Save vanilla sources as artifact
61+ - name : save vanilla source as artifact
7262 uses : actions/upload-artifact@v2
7363 with :
7464 name : vanilla-sources
7565 path : build/vanilla-src.zip
76-
77- make-enhanced-sources :
78- name : Make enhanced sources
79- needs : [make-vanilla-sources, preload-variables]
80- runs-on : ubuntu-latest
81- steps :
82- - uses : actions/checkout@v2
83- - name : Retrieve saved vanilla sources
84- uses : actions/download-artifact@v2
85- with :
86- name : vanilla-sources
87- path : build/vanilla-src.zip
88- - name : Unzip sources with 7z
89- working-directory : build
90- run : 7z x vanilla-src.zip
91- - name : Install icnsutils
92- run : sudo apt-get install -y icnsutils
93- - name : Enhance extracted sources
94- env :
95- NOTION_ENHANCER_COMMIT : ${{ needs.preload-variables.outputs.notion_enhancer_commit }}
96- run : scripts/enhance-src.sh
97- - name : Zip sources dir with 7z
66+ - name : zip enhanced source dir with 7z
9867 working-directory : build
9968 run : 7z a enhanced-src.zip enhanced-src
100- - name : Save enhanced sources as artifact
69+ - name : save enhanced source as artifact
10170 uses : actions/upload-artifact@v2
10271 with :
10372 name : enhanced-sources
10473 path : build/enhanced-src.zip
10574
10675 build-app :
107- name : Build app
108- needs : [make-vanilla-sources, make-enhanced -sources, preload-variables, create-release]
76+ name : build app
77+ needs : [generate -sources, preload-variables, create-release]
10978 runs-on : ${{ matrix.os }}
11079 env :
11180 NOTION_VERSION : ${{ needs.preload-variables.outputs.notion_version }}
@@ -131,34 +100,34 @@ jobs:
131100 - uses : actions/setup-node@v1
132101 with :
133102 node-version : 14
134- - name : Retrieve saved sources
103+ - name : retrieve saved sources
135104 uses : actions/download-artifact@v2
136105 with :
137106 name : ${{ matrix.edition }}-sources
138- path : sources .zip
139- - name : Unzip sources with 7z
140- run : 7z x sources .zip
107+ path : build/${{ matrix.edition }}-src .zip
108+ - name : unzip sources with 7z
109+ run : 7z x build/${{ matrix.edition }}-src .zip
141110 - name : Install Linux build dependencies
142111 if : matrix.os == 'ubuntu-latest'
143112 run : sudo apt-get install --no-install-recommends -y libopenjp2-tools rpm libarchive-tools
144- - name : Install dependencies
113+ - name : install dependencies
145114 working-directory : ${{ matrix.edition }}-src
146115 run : npm install
147- - name : Run patch-package
116+ - name : run patch-package
148117 working-directory : ${{ matrix.edition }}-src
149118 run : npx patch-package
150- - name : Install electron and electron-builder
119+ - name : install electron and electron-builder
151120 working-directory : ${{ matrix.edition }}-src
152121 run : npm install electron@11 electron-builder --save-dev
153- - name : Run electron-builder
122+ - name : run electron-builder
154123 working-directory : ${{ matrix.edition }}-src
155124 env :
156125 GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
157126 NOTION_REPACKAGED_EDITION : ${{ matrix.edition }}
158127 run : npx electron-builder --${{ matrix.target }} -c ../electron-builder.js
159128
160129 cleanup :
161- name : Cleanup artifacts
130+ name : cleanup artifacts
162131 if : always()
163132 needs : [build-app]
164133 strategy :
0 commit comments