Add snap and flatpak options to electron publishing and release
Also adds `deb` and tweaks the v3 compatibility test a bit more since it has failed a couple of times in the last week. Fixes #201
This commit is contained in:
parent
a312b9b177
commit
b1c6ea39ad
|
@ -48,6 +48,10 @@ jobs:
|
||||||
node_modules
|
node_modules
|
||||||
packages/electron/node_modules
|
packages/electron/node_modules
|
||||||
key: ${{ runner.os }}-${{ hashFiles('**/package-lock.json') }}
|
key: ${{ runner.os }}-${{ hashFiles('**/package-lock.json') }}
|
||||||
|
- name: Install Flatpak build tools
|
||||||
|
run: |
|
||||||
|
sudo apt install flatpak flatpak-builder
|
||||||
|
flatpak remote-add --if-not-exists --user flathub https://flathub.org/repo/flathub.flatpakrepo
|
||||||
- name: Install dependencies
|
- name: Install dependencies
|
||||||
run: |
|
run: |
|
||||||
npm i -g npm@8.2.0
|
npm i -g npm@8.2.0
|
||||||
|
@ -55,6 +59,7 @@ jobs:
|
||||||
- name: Build
|
- name: Build
|
||||||
run: |
|
run: |
|
||||||
npm run electron:build
|
npm run electron:build
|
||||||
|
npm run electron:build:flatpak
|
||||||
env:
|
env:
|
||||||
PL_PWA_URL: ${{ secrets.PL_PWA_URL }}
|
PL_PWA_URL: ${{ secrets.PL_PWA_URL }}
|
||||||
- name: Archive AppImage
|
- name: Archive AppImage
|
||||||
|
@ -63,6 +68,24 @@ jobs:
|
||||||
name: padloc-linux-${{ github.sha }}-unsigned.AppImage
|
name: padloc-linux-${{ github.sha }}-unsigned.AppImage
|
||||||
path: packages/electron/dist/*.AppImage
|
path: packages/electron/dist/*.AppImage
|
||||||
if-no-files-found: error
|
if-no-files-found: error
|
||||||
|
- name: Archive deb
|
||||||
|
uses: actions/upload-artifact@v2
|
||||||
|
with:
|
||||||
|
name: padloc-linux-${{ github.sha }}-unsigned.deb
|
||||||
|
path: packages/electron/dist/*.deb
|
||||||
|
if-no-files-found: error
|
||||||
|
- name: Archive snap
|
||||||
|
uses: actions/upload-artifact@v2
|
||||||
|
with:
|
||||||
|
name: padloc-linux-${{ github.sha }}-unsigned.snap
|
||||||
|
path: packages/electron/dist/*.snap
|
||||||
|
if-no-files-found: error
|
||||||
|
- name: Archive flatpak
|
||||||
|
uses: actions/upload-artifact@v2
|
||||||
|
with:
|
||||||
|
name: padloc-linux-${{ github.sha }}-unsigned.flatpak
|
||||||
|
path: packages/electron/dist/*.flatpak
|
||||||
|
if-no-files-found: error
|
||||||
- name: Archive Unpacked
|
- name: Archive Unpacked
|
||||||
uses: actions/upload-artifact@v2
|
uses: actions/upload-artifact@v2
|
||||||
with:
|
with:
|
||||||
|
|
|
@ -268,6 +268,11 @@ jobs:
|
||||||
if: matrix.platform == 'macos-latest'
|
if: matrix.platform == 'macos-latest'
|
||||||
run: |
|
run: |
|
||||||
brew install coreutils
|
brew install coreutils
|
||||||
|
- name: Install Flatpak build tools
|
||||||
|
if: matrix.platform == 'ubuntu-latest'
|
||||||
|
run: |
|
||||||
|
sudo apt install -y flatpak flatpak-builder
|
||||||
|
flatpak remote-add --if-not-exists --user flathub https://flathub.org/repo/flathub.flatpakrepo
|
||||||
- name: Install dependencies
|
- name: Install dependencies
|
||||||
run: |
|
run: |
|
||||||
npm i -g npm@8.2.0
|
npm i -g npm@8.2.0
|
||||||
|
@ -283,6 +288,14 @@ jobs:
|
||||||
PL_MACOS_NOTARIZE_PASSWORD: ${{ secrets.PL_MACOS_NOTARIZE_PASSWORD }}
|
PL_MACOS_NOTARIZE_PASSWORD: ${{ secrets.PL_MACOS_NOTARIZE_PASSWORD }}
|
||||||
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
EP_PRE_RELEASE: true
|
EP_PRE_RELEASE: true
|
||||||
|
- name: Build Flatpak
|
||||||
|
if: matrix.platform == 'ubuntu-latest'
|
||||||
|
run: |
|
||||||
|
npm run electron:build:flatpak
|
||||||
|
env:
|
||||||
|
PL_PWA_URL: ${{ secrets.PL_PWA_URL }}
|
||||||
|
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
EP_PRE_RELEASE: true
|
||||||
- name: Generate checksum (AppImage)
|
- name: Generate checksum (AppImage)
|
||||||
if: matrix.platform == 'ubuntu-latest'
|
if: matrix.platform == 'ubuntu-latest'
|
||||||
run: |
|
run: |
|
||||||
|
@ -297,6 +310,48 @@ jobs:
|
||||||
file: packages/electron/dist/sha256sum-appimage.txt
|
file: packages/electron/dist/sha256sum-appimage.txt
|
||||||
asset_name: sha256sum-electron-appimage.txt
|
asset_name: sha256sum-electron-appimage.txt
|
||||||
prerelease: true
|
prerelease: true
|
||||||
|
- name: Generate checksum (deb)
|
||||||
|
if: matrix.platform == 'ubuntu-latest'
|
||||||
|
run: |
|
||||||
|
cd packages/electron/dist
|
||||||
|
sha256sum *.deb > sha256sum-deb.txt
|
||||||
|
- name: Upload checksum (deb)
|
||||||
|
if: matrix.platform == 'ubuntu-latest'
|
||||||
|
uses: svenstaro/upload-release-action@2.2.1
|
||||||
|
with:
|
||||||
|
repo_token: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
tag: "v${{ env.PL_VENDOR_VERSION }}"
|
||||||
|
file: packages/electron/dist/sha256sum-deb.txt
|
||||||
|
asset_name: sha256sum-electron-deb.txt
|
||||||
|
prerelease: true
|
||||||
|
- name: Generate checksum (snap)
|
||||||
|
if: matrix.platform == 'ubuntu-latest'
|
||||||
|
run: |
|
||||||
|
cd packages/electron/dist
|
||||||
|
sha256sum *.snap > sha256sum-snap.txt
|
||||||
|
- name: Upload checksum (snap)
|
||||||
|
if: matrix.platform == 'ubuntu-latest'
|
||||||
|
uses: svenstaro/upload-release-action@2.2.1
|
||||||
|
with:
|
||||||
|
repo_token: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
tag: "v${{ env.PL_VENDOR_VERSION }}"
|
||||||
|
file: packages/electron/dist/sha256sum-snap.txt
|
||||||
|
asset_name: sha256sum-electron-snap.txt
|
||||||
|
prerelease: true
|
||||||
|
- name: Generate checksum (flatpak)
|
||||||
|
if: matrix.platform == 'ubuntu-latest'
|
||||||
|
run: |
|
||||||
|
cd packages/electron/dist
|
||||||
|
sha256sum *.flatpak > sha256sum-flatpak.txt
|
||||||
|
- name: Upload checksum (flatpak)
|
||||||
|
if: matrix.platform == 'ubuntu-latest'
|
||||||
|
uses: svenstaro/upload-release-action@2.2.1
|
||||||
|
with:
|
||||||
|
repo_token: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
tag: "v${{ env.PL_VENDOR_VERSION }}"
|
||||||
|
file: packages/electron/dist/sha256sum-flatpak.txt
|
||||||
|
asset_name: sha256sum-electron-flatpak.txt
|
||||||
|
prerelease: true
|
||||||
- name: Generate checksum (dmg)
|
- name: Generate checksum (dmg)
|
||||||
if: matrix.platform == 'macos-latest'
|
if: matrix.platform == 'macos-latest'
|
||||||
run: |
|
run: |
|
||||||
|
|
|
@ -28,3 +28,4 @@ packages/extension/dist
|
||||||
packages/tauri/dist
|
packages/tauri/dist
|
||||||
packages/tauri/src-tauri/icons
|
packages/tauri/src-tauri/icons
|
||||||
packages/tauri/tauri-update.json
|
packages/tauri/tauri-update.json
|
||||||
|
.flatpak-builder
|
||||||
|
|
|
@ -12,3 +12,4 @@ packages/tauri/tauri-update.json
|
||||||
packages/pwa/dist/**/*
|
packages/pwa/dist/**/*
|
||||||
package-lock.json
|
package-lock.json
|
||||||
cypress/fixtures/**/*
|
cypress/fixtures/**/*
|
||||||
|
.flatpak-builder/**/*
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
{
|
{
|
||||||
"name": "Padloc",
|
"name": "Padloc",
|
||||||
"background_color": "#ffffff",
|
"background_color": "#ffffff",
|
||||||
"description": "A modern password manager for indviduals and teams",
|
"description": "A modern password manager for individuals and teams",
|
||||||
"appId": "app.padloc",
|
"appId": "app.padloc",
|
||||||
"scheme": "padloc",
|
"scheme": "padloc",
|
||||||
"author": "Martin Kleinschrodt <martin@maklesoft.com>",
|
"author": "Martin Kleinschrodt <martin@maklesoft.com>",
|
||||||
|
|
|
@ -36,7 +36,7 @@ describe("v3 compatibility", () => {
|
||||||
cy.doWithin(["pl-app", "pl-items-list"], () => cy.get("pl-icon[icon='add']").click());
|
cy.doWithin(["pl-app", "pl-items-list"], () => cy.get("pl-icon[icon='add']").click());
|
||||||
|
|
||||||
// Click create
|
// Click create
|
||||||
cy.doWithin(["pl-app", "pl-create-item-dialog"], () => cy.get(".footer button.primary").click(), 200);
|
cy.doWithin(["pl-app", "pl-create-item-dialog"], () => cy.get(".footer button.primary").click(), 500);
|
||||||
|
|
||||||
cy.url().should("match", /\/items\/[0-9a-f]{8}-[0-9a-f]{4}-[0-5][0-9a-f]{3}-[089ab][0-9a-f]{3}-[0-9a-f]{12}/);
|
cy.url().should("match", /\/items\/[0-9a-f]{8}-[0-9a-f]{4}-[0-5][0-9a-f]{3}-[089ab][0-9a-f]{3}-[0-9a-f]{12}/);
|
||||||
|
|
||||||
|
@ -64,7 +64,7 @@ describe("v3 compatibility", () => {
|
||||||
// Close dialog
|
// Close dialog
|
||||||
cy.get("pl-icon[icon='close']").click();
|
cy.get("pl-icon[icon='close']").click();
|
||||||
},
|
},
|
||||||
1200
|
1500
|
||||||
);
|
);
|
||||||
|
|
||||||
cy.url().should("include", "/items");
|
cy.url().should("include", "/items");
|
||||||
|
|
|
@ -35,6 +35,7 @@
|
||||||
"server:start-dry": "lerna run start-dry --stream --scope @padloc/server",
|
"server:start-dry": "lerna run start-dry --stream --scope @padloc/server",
|
||||||
"electron:start": "lerna run start --scope @padloc/electron",
|
"electron:start": "lerna run start --scope @padloc/electron",
|
||||||
"electron:build": "lerna run build --scope @padloc/electron",
|
"electron:build": "lerna run build --scope @padloc/electron",
|
||||||
|
"electron:build:flatpak": "lerna run build:flatpak",
|
||||||
"web-extension:build": "lerna run build --scope @padloc/extension",
|
"web-extension:build": "lerna run build --scope @padloc/extension",
|
||||||
"cordova:start:android": "lerna run start:android",
|
"cordova:start:android": "lerna run start:android",
|
||||||
"cordova:start:ios": "lerna run start:ios",
|
"cordova:start:ios": "lerna run start:ios",
|
||||||
|
@ -55,7 +56,7 @@
|
||||||
"test:e2e": "concurrently --prefix=name --prefix-length=30 --kill-others --success=first -n app,v3-app,maildev,cypress \"PL_DATA_BACKEND=memory PL_DISABLE_SW=true PL_EMAIL_BACKEND=smtp PL_EMAIL_SMTP_HOST=localhost PL_EMAIL_SMTP_PORT=1025 PL_EMAIL_SMTP_IGNORE_TLS=true npm start\" \"npm run start:v3\" \"npx maildev\" \"./node_modules/.bin/wait-on tcp:localhost:8080 && CYPRESS_CRASH_REPORTS=0 cypress run\"",
|
"test:e2e": "concurrently --prefix=name --prefix-length=30 --kill-others --success=first -n app,v3-app,maildev,cypress \"PL_DATA_BACKEND=memory PL_DISABLE_SW=true PL_EMAIL_BACKEND=smtp PL_EMAIL_SMTP_HOST=localhost PL_EMAIL_SMTP_PORT=1025 PL_EMAIL_SMTP_IGNORE_TLS=true npm start\" \"npm run start:v3\" \"npx maildev\" \"./node_modules/.bin/wait-on tcp:localhost:8080 && CYPRESS_CRASH_REPORTS=0 cypress run\"",
|
||||||
"test:e2e:dev": "concurrently --prefix=name --prefix-length=30 --kill-others --success=first -n app,v3-app,cypress \"PL_DATA_BACKEND=memory PL_DISABLE_SW=true PL_EMAIL_BACKEND=smtp PL_EMAIL_SMTP_HOST=localhost PL_EMAIL_SMTP_PORT=1025 PL_EMAIL_SMTP_IGNORE_TLS=true npm run dev\" \"npm run start:v3\" \"npx maildev\" \"./node_modules/.bin/wait-on tcp:localhost:8080 && CYPRESS_CRASH_REPORTS=0 cypress open\"",
|
"test:e2e:dev": "concurrently --prefix=name --prefix-length=30 --kill-others --success=first -n app,v3-app,cypress \"PL_DATA_BACKEND=memory PL_DISABLE_SW=true PL_EMAIL_BACKEND=smtp PL_EMAIL_SMTP_HOST=localhost PL_EMAIL_SMTP_PORT=1025 PL_EMAIL_SMTP_IGNORE_TLS=true npm run dev\" \"npm run start:v3\" \"npx maildev\" \"./node_modules/.bin/wait-on tcp:localhost:8080 && CYPRESS_CRASH_REPORTS=0 cypress open\"",
|
||||||
"locale:extract": "lerna run extract --scope '@padloc/locale'",
|
"locale:extract": "lerna run extract --scope '@padloc/locale'",
|
||||||
"add": "lerna add $1 --scope=@padloc/$scope",
|
"add": "lerna add $1 --exact --scope=@padloc/$scope",
|
||||||
"remove": "rm packages/$scope/package-lock.json && lerna exec \"npm uninstall $1\" --scope=@padloc/$scope",
|
"remove": "rm packages/$scope/package-lock.json && lerna exec \"npm uninstall $1\" --scope=@padloc/$scope",
|
||||||
"prettier": "prettier --write .",
|
"prettier": "prettier --write .",
|
||||||
"prettier:check": "prettier --check .",
|
"prettier:check": "prettier --check .",
|
||||||
|
|
|
@ -14,6 +14,7 @@
|
||||||
},
|
},
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"build": "rm -rf app build dist && webpack && node ./prepare-build.js && electron-builder --config build/build.json",
|
"build": "rm -rf app build dist && webpack && node ./prepare-build.js && electron-builder --config build/build.json",
|
||||||
|
"build:flatpak": "electron-builder --config build/build-flatpak.json",
|
||||||
"start": "webpack && electron app/main.js"
|
"start": "webpack && electron app/main.js"
|
||||||
},
|
},
|
||||||
"author": "MaKleSoft UG",
|
"author": "MaKleSoft UG",
|
||||||
|
|
|
@ -17,6 +17,7 @@ async function main() {
|
||||||
const { width } = await baseIcon.metadata();
|
const { width } = await baseIcon.metadata();
|
||||||
const padding = Math.floor(width / 20);
|
const padding = Math.floor(width / 20);
|
||||||
await baseIcon
|
await baseIcon
|
||||||
|
.resize(512 - padding * 2, 512 - padding * 2, { fit: "inside" }) // Some targets don't deal well with images > 512x512
|
||||||
.extend({
|
.extend({
|
||||||
top: padding,
|
top: padding,
|
||||||
right: padding,
|
right: padding,
|
||||||
|
@ -49,12 +50,28 @@ async function main() {
|
||||||
schemes: [scheme],
|
schemes: [scheme],
|
||||||
},
|
},
|
||||||
linux: {
|
linux: {
|
||||||
|
target: ["AppImage", "snap", "deb", "dir"],
|
||||||
category: "Utility",
|
category: "Utility",
|
||||||
},
|
},
|
||||||
|
snap: {
|
||||||
|
confinement: "classic",
|
||||||
|
},
|
||||||
afterSign: "scripts/notarize.js",
|
afterSign: "scripts/notarize.js",
|
||||||
};
|
};
|
||||||
|
|
||||||
fs.writeFileSync(join(buildDir, "build.json"), JSON.stringify(buildConfig, null, 4), "utf-8");
|
fs.writeFileSync(join(buildDir, "build.json"), JSON.stringify(buildConfig, null, 4), "utf-8");
|
||||||
|
|
||||||
|
// Write flatpak-specific config, which has a few more restrictions
|
||||||
|
const flatpakConfig = {
|
||||||
|
...buildConfig,
|
||||||
|
appId: appId.split(".").length > 2 ? appId : `${appId}.app`, // appId needs to have 2 periods and can't finish on one
|
||||||
|
linux: {
|
||||||
|
...buildConfig.linux,
|
||||||
|
target: "flatpak",
|
||||||
|
},
|
||||||
|
};
|
||||||
|
|
||||||
|
fs.writeFileSync(join(buildDir, "build-flatpak.json"), JSON.stringify(flatpakConfig, null, 4), "utf-8");
|
||||||
}
|
}
|
||||||
|
|
||||||
main();
|
main();
|
||||||
|
|
Loading…
Reference in New Issue