Skip to content

Commit

Permalink
Tools: Fix Windows build and improve CI error handling
Browse files Browse the repository at this point in the history
  • Loading branch information
laurent22 committed Jan 17, 2022
1 parent 5143a81 commit 3a18da4
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 4 deletions.
16 changes: 13 additions & 3 deletions .github/workflows/github-actions-main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -86,10 +86,20 @@ jobs:
GH_TOKEN: ${{ secrets.GH_TOKEN }}
IS_CONTINUOUS_INTEGRATION: 1
BUILD_SEQUENCIAL: 1
# To ensure that the operations stop on failure, all commands
# should be on one line with "&&" in between.
run: |
yarn install
cd packages/app-desktop
yarn run dist
yarn install && cd packages/app-desktop && yarn run dist
# Build and package the Windows app, without publishing it, just to
# verify that the build process hasn't been broken.
- name: Build Windows app (no publishing)
if: runner.os == 'Windows' && !startsWith(github.ref, 'refs/tags/v')
env:
IS_CONTINUOUS_INTEGRATION: 1
BUILD_SEQUENCIAL: 1
run: |
yarn install && cd packages/app-desktop && yarn run dist --publish=never
ServerDockerImage:
runs-on: ${{ matrix.os }}
Expand Down
5 changes: 4 additions & 1 deletion packages/app-desktop/tools/compileScripts.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,10 @@ function convertJsx(path) {

if (fileIsNewerThan(jsxPath, jsPath)) {
console.info(`Compiling ${jsxPath}...`);
const result = spawnSync('yarn', ['run', 'babel', '--presets', 'react', '--out-file', jsPath, jsxPath]);

// { shell: true } is needed to get it working on Windows:
// https://discourse.joplinapp.org/t/attempting-to-build-on-windows/22559/12
const result = spawnSync('yarn', ['run', 'babel', '--presets', 'react', '--out-file', jsPath, jsxPath], { shell: true });
if (result.status !== 0) {
const msg = [];
if (result.stdout) msg.push(result.stdout.toString());
Expand Down

0 comments on commit 3a18da4

Please sign in to comment.