From 080f6de05e041cabd694996a3d4cee460113a89b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Karol=20S=C3=B3jko?= Date: Thu, 7 Dec 2023 08:07:55 +0100 Subject: [PATCH] chore: fix linux builds by breaking apart --- .github/workflows/desktop.release.reuse.yml | 135 +++++++++++++++++--- 1 file changed, 118 insertions(+), 17 deletions(-) diff --git a/.github/workflows/desktop.release.reuse.yml b/.github/workflows/desktop.release.reuse.yml index c20d01e12..00ad4094d 100644 --- a/.github/workflows/desktop.release.reuse.yml +++ b/.github/workflows/desktop.release.reuse.yml @@ -56,7 +56,8 @@ jobs: packages/desktop/dist/*.yml packages/desktop/dist/*.yaml - Linux: + Linux-AppImage: + name: Linux AppImage runs-on: ubuntu-latest defaults: run: @@ -68,8 +69,6 @@ jobs: registry-url: 'https://registry.npmjs.org' node-version-file: '.nvmrc' cache: 'yarn' - - name: Set up Ruby - uses: ruby/setup-ruby@v1 - name: Setup Python uses: actions/setup-python@v4 with: @@ -79,6 +78,9 @@ jobs: - run: yarn install --immutable + - name: Rebuild Electron Native Modules + run: yarn workspace @standardnotes/desktop rebuild:home-server + - run: yarn build:desktop - run: echo APP_VERSION=$(node -p "require('./../web/package.json').version") >> $GITHUB_ENV @@ -92,6 +94,84 @@ jobs: - name: AppImageArm64 run: yarn run electron-builder --linux --arm64 -c.linux.target=AppImage --publish=never --c.extraMetadata.version=${{ env.APP_VERSION }} + - name: Upload + uses: actions/upload-artifact@v3.0.0 + with: + name: assets + path: | + packages/desktop/dist/*.AppImage + packages/desktop/dist/*.yml + packages/desktop/dist/*.yaml + + Linux-Dir: + name: Linux Dir + runs-on: ubuntu-latest + defaults: + run: + working-directory: packages/desktop + steps: + - uses: actions/checkout@v3 + - uses: actions/setup-node@v3 + with: + registry-url: 'https://registry.npmjs.org' + node-version-file: '.nvmrc' + cache: 'yarn' + - name: Setup Python + uses: actions/setup-python@v4 + with: + python-version: '3.10' + - name: Install FPM + run: sudo gem install fpm -f + + - run: yarn install --immutable + + - name: Rebuild Electron Native Modules + run: yarn workspace @standardnotes/desktop rebuild:home-server + + - run: yarn build:desktop + + - run: echo APP_VERSION=$(node -p "require('./../web/package.json').version") >> $GITHUB_ENV + + - name: Dir + run: | + yarn run webpack --config desktop.webpack.prod.js + yarn run electron-builder --linux --x64 -c.linux.target=dir --publish=never --c.extraMetadata.version=${{ env.APP_VERSION }} + - name: DirArm64 + run: | + yarn run webpack --config desktop.webpack.prod.js + yarn run electron-builder --linux --arm64 -c.linux.target=dir --publish=never --c.extraMetadata.version=${{ env.APP_VERSION }} + env: + npm_config_target_arch: 'arm64' + + Linux-Deb: + name: Linux Deb + runs-on: ubuntu-latest + defaults: + run: + working-directory: packages/desktop + steps: + - uses: actions/checkout@v3 + - uses: actions/setup-node@v3 + with: + registry-url: 'https://registry.npmjs.org' + node-version-file: '.nvmrc' + cache: 'yarn' + - name: Setup Python + uses: actions/setup-python@v4 + with: + python-version: '3.10' + - name: Install FPM + run: sudo gem install fpm -f + + - run: yarn install --immutable + + - name: Rebuild Electron Native Modules + run: yarn workspace @standardnotes/desktop rebuild:home-server + + - run: yarn build:desktop + + - run: echo APP_VERSION=$(node -p "require('./../web/package.json').version") >> $GITHUB_ENV + - name: Deb run: | yarn run webpack --config desktop.webpack.prod.js --env deb @@ -104,16 +184,40 @@ jobs: yarn run webpack --config desktop.webpack.prod.js --env deb yarn run electron-builder --linux --arm64 -c.linux.target=deb --publish=never --c.extraMetadata.version=${{ env.APP_VERSION }} - - name: Dir - run: | - yarn run webpack --config desktop.webpack.prod.js - yarn run electron-builder --linux --x64 -c.linux.target=dir --publish=never --c.extraMetadata.version=${{ env.APP_VERSION }} - - name: DirArm64 - run: | - yarn run webpack --config desktop.webpack.prod.js - yarn run electron-builder --linux --arm64 -c.linux.target=dir --publish=never --c.extraMetadata.version=${{ env.APP_VERSION }} - env: - npm_config_target_arch: 'arm64' + - name: Upload + uses: actions/upload-artifact@v3.0.0 + with: + name: assets + path: | + packages/desktop/dist/*.deb + packages/desktop/dist/*.yml + packages/desktop/dist/*.yaml + + Linux-Snap: + name: Linux Snap + runs-on: ubuntu-latest + defaults: + run: + working-directory: packages/desktop + steps: + - uses: actions/checkout@v3 + - uses: actions/setup-node@v3 + with: + registry-url: 'https://registry.npmjs.org' + node-version-file: '.nvmrc' + cache: 'yarn' + - name: Setup Python + uses: actions/setup-python@v4 + with: + python-version: '3.10' + - name: Install FPM + run: sudo gem install fpm -f + + - run: yarn install --immutable + + - run: yarn build:desktop + + - run: echo APP_VERSION=$(node -p "require('./../web/package.json').version") >> $GITHUB_ENV - name: Install Snapcraft run: | @@ -139,9 +243,6 @@ jobs: name: assets path: | packages/desktop/dist/*.snap - packages/desktop/dist/*.AppImage - packages/desktop/dist/*.deb - packages/desktop/dist/*.blockmap packages/desktop/dist/*.yml packages/desktop/dist/*.yaml @@ -232,7 +333,7 @@ jobs: env: SNAPCRAFT_STORE_CREDENTIALS: ${{ secrets.SNAPCRAFT_STORE_CREDENTIALS }} if: ${{ always() }} - needs: [Windows, Mac, Linux] + needs: [Windows, Mac, Linux-AppImage, Linux-Dir, Linux-Deb, Linux-Snap] defaults: run: working-directory: packages/desktop