Skip to content

Commit

Permalink
Merge pull request ankicommunity#64 from dobefore/catches-up-with-new…
Browse files Browse the repository at this point in the history
…-sync-protocol-of-anki

catches-up-with-new-sync-protocol
  • Loading branch information
dobefore committed Feb 7, 2023
2 parents b7a65dc + e840736 commit b295310
Show file tree
Hide file tree
Showing 29 changed files with 2,055 additions and 2,265 deletions.
14 changes: 10 additions & 4 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -56,10 +56,16 @@ jobs:
toolchain: stable
override: true

- name: Install protoc
run: |
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
brew install protobuf
- name: Install Protoc
uses: arduino/setup-protoc@v1
with:
version: '3.x'
repo-token: ${{ secrets.GITHUB_TOKEN }}

# - name: Install protoc
# run: |
# /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
# brew install protobuf

- name: Set up python
uses: actions/setup-python@v2
Expand Down
57 changes: 19 additions & 38 deletions .github/workflows/docker_push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,13 +49,7 @@ jobs:

- name: unpack cross-compile toolchains musl
run: tar -zxvf $HOME/x86_64-linux-musl-cross.tgz -C $HOME
# - name: Install Protoc
# run: |
# PB_REL="https://github.com/protocolbuffers/protobuf/releases"
# curl -LO $PB_REL/download/v3.15.8/protoc-3.15.8-linux-x86_64.zip
# mkdir -p $HOME/protoc
# unzip protoc-3.15.8-linux-x86_64.zip -d $HOME/protoc


# # openssl
- uses: robinraju/release-downloader@v1.4
with:
Expand All @@ -70,18 +64,6 @@ jobs:
tar -zxvf $HOME/openssl1.1.1f_1.1.1_linux_x64.tar.gz -C $HOME
cp -r $HOME/openssl1.1.1f_1.1.1_linux_x64/openssl/ $HOME
# sqlite3
# - uses: robinraju/release-downloader@v1.4
# with:
# repository: "dobefore/cross-compile-sqlite-musl"
# tag: "0.1.2"
# fileName: "sqliteautoconf3390000_0.1.2_linux_arm64.tar.gz"

# - name: unpack sqlite3
# run: |
# tar -zxvf sqliteautoconf3390000_0.1.2_linux_arm64.tar.gz.tar.gz
# cp -r sqliteautoconf3390000_0.1.2_linux_arm64.tar.gz/sql/ .

- name: Build
run: |
export OPENSSL_LIB_DIR=$HOME/openssl/lib
Expand Down Expand Up @@ -135,7 +117,7 @@ jobs:
# mkdir -p $HOME/protoc
# unzip protoc-3.15.8-linux-x86_64.zip -d $HOME/protoc

- name: Add cargo taget armv6
- name: Add cargo taget arm64
run: rustup target add aarch64-unknown-linux-musl

- uses: robinraju/release-downloader@v1.4
Expand All @@ -162,23 +144,26 @@ jobs:
run: |
tar -zxvf $HOME/openssl1.1.1f_1.1.1_linux_arm64.tar.gz -C $HOME
cp -r $HOME/openssl1.1.1f_1.1.1_linux_arm64/openssl/ $HOME
# sqlite3
- uses: robinraju/release-downloader@v1.4
with:
repository: "dobefore/cross-compile-sqlite-musl"
tag: "0.1.2"
fileName: "sqliteautoconf3390000_0.1.2_linux_arm64.tar.gz"
# # sqlite3 seems to need it any more,
# - uses: robinraju/release-downloader@v1.4
# with:
# repository: "dobefore/cross-compile-sqlite-musl"
# tag: "0.1.2"
# fileName: "sqliteautoconf3390000_0.1.2_linux_arm64.tar.gz"

# - name: Copy sqlite lib to home
# run: cp sqliteautoconf3390000_0.1.2_linux_arm64.tar.gz $HOME

# tar -zxvf $HOME/sqliteautoconf3390000_0.1.2_linux_arm64.tar.gz -C $HOME
- name: unpack sqlite3
run: |
tar -zxvf sqliteautoconf3390000_0.1.2_linux_arm64.tar.gz
cp -r sqliteautoconf3390000_0.1.2_linux_arm64/sql/ .
cp -r sql/ $HOME
# - name: unpack sqlite3
# run: |
# tar -zxvf sqliteautoconf3390000_0.1.2_linux_arm64.tar.gz
# cp -r sqliteautoconf3390000_0.1.2_linux_arm64/sql/ .
# cp -r sql/ $HOME
# export SQLITE3_LIB_DIR=$HOME/sql/lib
# export SQLITE3_INCLUDE_DIR=$HOME/sql/include
# cp -r $HOME/sql/ .

# build static-linked binary for armv6 (also suitable for aarch64)

- name: Build
Expand All @@ -187,16 +172,12 @@ jobs:
export OPENSSL_INCLUDE_DIR=$HOME/openssl/include
export OPENSSL_STATIC=true
export SQLITE3_LIB_DIR=$HOME/sql/lib
export SQLITE3_INCLUDE_DIR=$HOME/sql/include
export SQLITE3_STATIC=1
ls
cp -r $HOME/sql/ .
export PATH="$HOME/aarch64-linux-musl-cross/bin:$PATH"
cargo build --target aarch64-unknown-linux-musl --release
# - name: Strip binaries (ankisyncd)
# run: $HOME/aarch64-linux-musl-cross/bin/arm-linux-musleabihf-strip target/aarch64-unknown-linux-musl/release/ankisyncd
- name: Strip binaries (ankisyncd)
run: $HOME/aarch64-linux-musl-cross/bin/aarch64-linux-musl-strip target/aarch64-unknown-linux-musl/release/ankisyncd

- run: mv target/aarch64-unknown-linux-musl/release/ankisyncd aarch64-unknown-linux-musl-ankisyncd

Expand Down
Loading

0 comments on commit b295310

Please sign in to comment.