1414 NOTION_REPACKAGED_DEBUG : true
1515
1616jobs :
17+ preload-variables :
18+ name : Preload variables
19+ runs-on : ubuntu-latest
20+ steps :
21+ - uses : actions/checkout@v2
22+ - id : preload-variables
23+ name : Load variables and set them as outputs
24+ run : |
25+ source notion-repackaged.env
26+
27+ echo "::set-output name=notion_version::$NOTION_VERSION"
28+ 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"
31+
32+ NOTION_REPACKAGED_VERSION_REV="${NOTION_VERSION}-${NOTION_REPACKAGED_REVISION}"
33+ echo "::set-output name=notion_repackaged_version_rev::$NOTION_REPACKAGED_VERSION_REV"
34+ outputs :
35+ notion_version : ${{ steps.preload-variables.outputs.notion_version }}
36+ notion_repackaged_revision : ${{ steps.preload-variables.outputs.notion_repackaged_revision }}
37+ 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 }}
40+
1741 create-release :
1842 name : Create release
1943 runs-on : ubuntu-latest
44+ needs : [preload-variables]
2045 steps :
2146 - uses : actions/checkout@v2
22- - run : grep -v '^#' notion-repackaged.env >> $GITHUB_ENV
2347 - uses : release-drafter/release-drafter@v5
2448 env :
2549 GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
2650 with :
27- version : " ${{ env.NOTION_VERSION }}-${{ env.NOTION_REPACKAGED_REVISION }}"
51+ version : ${{ needs.preload-variables.outputs.notion_repackaged_version_rev }}
2852
2953 make-vanilla-sources :
3054 name : Make vanilla sources
3155 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 }}
3260 steps :
3361 - uses : actions/checkout@v2
34- - run : grep -v '^#' notion-repackaged.env >> $GITHUB_ENV
3562 - name : Download official Windows build
63+ env :
64+ NOTION_DOWNLOAD_HASH : ${{ needs.preload-variables.outputs.notion_download_hash }}
3665 run : scripts/download-exe.sh
3766 - name : Extract sources from Windows Build
3867 run : scripts/extract-src.sh
@@ -47,11 +76,10 @@ jobs:
4776
4877 make-enhanced-sources :
4978 name : Make enhanced sources
50- needs : [make-vanilla-sources]
79+ needs : [make-vanilla-sources, preload-variables ]
5180 runs-on : ubuntu-latest
5281 steps :
5382 - uses : actions/checkout@v2
54- - run : grep -v '^#' notion-repackaged.env >> $GITHUB_ENV
5583 - name : Retrieve saved vanilla sources
5684 uses : actions/download-artifact@v2
5785 with :
6391 - name : Install icnsutils
6492 run : sudo apt-get install -y icnsutils
6593 - name : Enhance extracted sources
94+ env :
95+ NOTION_ENHANCER_COMMIT : ${{ needs.preload-variables.outputs.notion_enhancer_commit }}
6696 run : scripts/enhance-src.sh
6797 - name : Zip sources dir with 7z
6898 working-directory : build
@@ -75,8 +105,11 @@ jobs:
75105
76106 build-app :
77107 name : Build app
78- needs : [make-vanilla-sources, make-enhanced-sources, create-release ]
108+ needs : [make-vanilla-sources, make-enhanced-sources, preload-variables ]
79109 runs-on : ${{ matrix.os }}
110+ env :
111+ NOTION_VERSION : ${{ needs.preload-variables.outputs.notion_version }}
112+ NOTION_REPACKAGED_REVISION : ${{ needs.preload-variables.outputs.notion_repackaged_revision }}
80113 strategy :
81114 matrix :
82115 target : [windows, linux, macos]
95128 edition : vanilla
96129 steps :
97130 - uses : actions/checkout@v2
98- - run : grep -v '^#' notion-repackaged.env >> $GITHUB_ENV
99131 - uses : actions/setup-node@v1
100132 with :
101133 node-version : 14
@@ -123,8 +155,6 @@ jobs:
123155 env :
124156 GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
125157 NOTION_REPACKAGED_EDITION : ${{ matrix.edition }}
126- NOTION_VERSION : ${{ env.NOTION_VERSION }}
127- NOTION_REPACKAGED_REVISION : ${{ env.NOTION_REPACKAGED_REVISION }}
128158 run : npx electron-builder --${{ matrix.target }} -c ../electron-builder.js
129159
130160 cleanup :
0 commit comments