Skip to content

Commit

Permalink
chore: fix building snap packages (#2683)
Browse files Browse the repository at this point in the history
* chore: fix building snap packages

* add electron native modules rebuild before snap build

* update snap core env

* remove rebuilds

* update electron builder

* remove base argument from snap

* add review tools

* Revert "remove rebuilds"

This reverts commit 9004d20.

* fix snap review command

* review tools on test

* change base for snap

* add stage pacakges

* reduce test build to snap only

* fix plugs

* change base to core20

* instal lxd

* install snapcraft with lxd

* fix lxd install

* fix lxd init

* fix lxd configuration

* fix username

* fix permissions

* setup lxd from cannonical

* fix snap packaging

* fix canonical ref

* fix stage-packages

* add build packages to snap

* tmp disable native modules

* fix final step

* fix evernote specs
  • Loading branch information
karolsojko authored Dec 7, 2023
1 parent ed5767f commit 6f5e1d5
Show file tree
Hide file tree
Showing 39 changed files with 208 additions and 217 deletions.
17 changes: 13 additions & 4 deletions .github/workflows/desktop.release.reuse.yml
Original file line number Diff line number Diff line change
Expand Up @@ -79,9 +79,6 @@ 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
Expand Down Expand Up @@ -118,12 +115,24 @@ jobs:
env:
npm_config_target_arch: 'arm64'

- name: Snap
- name: Install Snapcraft
run: |
sudo snap install snapcraft --classic
- name: Setup LXD
uses: canonical/[email protected]

- name: Install Review Tools
run: sudo snap install review-tools

- name: Package Snap
run: |
yarn run webpack --config desktop.webpack.prod.js --env snap
yarn run electron-builder --linux --x64 -c.linux.target=snap --publish=never --c.extraMetadata.version=${{ env.APP_VERSION }}
- name: Review Snap
run: review-tools.snap-review dist/standard-notes-${{ env.APP_VERSION }}-linux-amd64.snap

- name: Upload
uses: actions/[email protected]
with:
Expand Down
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file removed .yarn/cache/asar-npm-3.2.0-ce87ce2b73-f7d30b4597.zip
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
15 changes: 13 additions & 2 deletions packages/desktop/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@
"ava": "^5.1.0",
"babel-loader": "^9.1.0",
"copy-webpack-plugin": "^11.0.0",
"electron-builder": "23.6.0",
"electron-builder": "^24.9.1",
"electron-rebuild": "^3.2.9",
"eslint": "*",
"eslint-config-prettier": "^8.9.0",
Expand Down Expand Up @@ -142,9 +142,20 @@
]
},
"snap": {
"base": "core22",
"buildPackages": [
"python3",
"libpython3.10"
],
"stagePackages": [
"default",
"python3",
"libpython3.10"
],
"plugs": [
"default",
"password-manager-service"
"password-manager-service",
"network-bind"
]
}
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -93,11 +93,11 @@ describe('EvernoteConverter', () => {
expect(result?.length).toBe(3)
expect(result?.[0].content_type).toBe(ContentType.TYPES.Note)
expect((result?.[0] as DecryptedTransferPayload<NoteContent>).content.text).toBe(
'<div>This is a test.</div><font><span>h </span><span>e </span></font>',
'<p>This is a test.</p><ul></ul><ol></ol><font><span>h </span><span>e </span></font>',
)
expect(result?.[1].content_type).toBe(ContentType.TYPES.Note)
expect((result?.[1] as DecryptedTransferPayload<NoteContent>).content.text).toBe(
'<div>Lorem ipsum dolor sit amet, consectetur adipiscing elit.</div>',
'<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit.</p>',
)
expect(result?.[2].content_type).toBe(ContentType.TYPES.Tag)
expect((result?.[2] as DecryptedTransferPayload<TagContent>).content.title).toBe('distant reading')
Expand Down
Loading

0 comments on commit 6f5e1d5

Please sign in to comment.