Skip to content

Commit

Permalink
Add github build scripts
Browse files Browse the repository at this point in the history
  • Loading branch information
DianQK committed Dec 2, 2023
1 parent 52f1894 commit 3de49e9
Show file tree
Hide file tree
Showing 12 changed files with 761 additions and 8 deletions.
43 changes: 43 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
name: CI

on:
push:
branches: [ "master" ]
tags:
- "v*.*.*"

jobs:
build:
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v4
with:
node-version: 18
- name: Download
run: bash scripts/download.sh
- name: Patch
run: bash scripts/patch.sh
- name: Install
run: bash scripts/install.sh
- name: Build
run: bash scripts/build.sh
- name: Archive
run: bash scripts/archive.sh
- name: Upload artifact
uses: actions/upload-artifact@v3
with:
name: resources
path: resources.tar.gz
- uses: ncipollo/release-action@v1
name: Release
if: startsWith(github.ref, 'refs/tags/')
with:
artifacts: "resources.tar.gz"
token: ${{ secrets.GITHUB_TOKEN }}
generateReleaseNotes: true
allowUpdates: true
removeArtifacts: true
replacesArtifacts: true
9 changes: 2 additions & 7 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,7 +1,2 @@
*
!.gitignore
!.SRCINFO
!PKGBUILD
!joplin.desktop
!joplin.sh
!0001-support-enable-wayland-ime.patch
/joplin
/resources.tar.gz
661 changes: 661 additions & 0 deletions LICENSE

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion PKGBUILD
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ sha256sums=(
prepare() {
export ELECTRON_SKIP_BINARY_DOWNLOAD=1

patch -Np1 -i "${srcdir}"/0001-support-enable-wayland-ime.patch -d "${srcdir}/joplin-${pkgver}"
patch -Np1 -i "${srcdir}"/patches/0001-support-enable-wayland-ime.patch -d "${srcdir}/joplin-${pkgver}"

msg2 "Disabling husky (git hooks)"
sed -i '/"husky": ".*"/d' "$srcdir/joplin-${pkgver}/package.json"
Expand Down
File renamed without changes.
16 changes: 16 additions & 0 deletions patches/0002-remove-7zip.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
diff --git a/packages/app-desktop/package.json b/packages/app-desktop/package.json
index cb247dc..fcc0874 100644
--- a/packages/app-desktop/package.json
+++ b/packages/app-desktop/package.json
@@ -127,11 +127,6 @@
"react-test-renderer": "18.2.0",
"typescript": "5.1.3"
},
- "optionalDependencies": {
- "7zip-bin-linux": "^1.0.1",
- "7zip-bin-mac": "^1.0.1",
- "7zip-bin-win": "^2.1.1"
- },
"dependencies": {
"@electron/notarize": "1.2.4",
"@electron/remote": "2.0.10",
13 changes: 13 additions & 0 deletions patches/0003-asar-unpack-node.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
diff --git a/packages/app-desktop/package.json b/packages/app-desktop/package.json
index cb247dc..5fbcf1a 100644
--- a/packages/app-desktop/package.json
+++ b/packages/app-desktop/package.json
@@ -39,7 +39,7 @@
],
"afterAllArtifactBuild": "./generateSha512.js",
"asar": true,
- "asarUnpack": "./node_modules/node-notifier/vendor/**",
+ "asarUnpack": "./node_modules/**/*.node",
"win": {
"rfc3161TimeStampServer": "http://timestamp.digicert.com",
"icon": "../../Assets/ImageSources/Joplin.ico",
1 change: 1 addition & 0 deletions scripts/archive.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
tar -cvzf resources.tar.gz --directory=joplin/packages/app-desktop/dist/linux-unpacked/resources .
4 changes: 4 additions & 0 deletions scripts/build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
pushd joplin
yarn workspace @joplin/app-desktop build
yarn workspace @joplin/app-desktop electron-builder --linux
popd
7 changes: 7 additions & 0 deletions scripts/download.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
VERSION=2.12.19
URL="https://github.com/laurent22/joplin/archive/refs/tags/v$VERSION.tar.gz"
echo "Downloading $URL"
wget -O joplin.tar.gz $URL
tar -xvzf joplin.tar.gz
rm joplin.tar.gz
mv joplin-$VERSION joplin
3 changes: 3 additions & 0 deletions scripts/install.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
pushd joplin
YARN_ENABLE_IMMUTABLE_INSTALLS=false yarn install
popd
10 changes: 10 additions & 0 deletions scripts/patch.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
cp -r patches ./joplin
patch -Np1 -i patches/0001-support-enable-wayland-ime.patch -d joplin
patch -Np1 -i patches/0002-remove-7zip.patch -d joplin
patch -Np1 -i patches/0003-asar-unpack-node.patch -d joplin

sed -i '/"husky": ".*"/d' joplin/package.json

rm -rf joplin/packages/app-mobile
rm -rf joplin/packages/app-clipper
rm -rf joplin/packages/app-cli

0 comments on commit 3de49e9

Please sign in to comment.