Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/improve UI #2

Merged
merged 16 commits into from
Jun 3, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
149 changes: 24 additions & 125 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
name: CI
# See https://help.github.com/en/actions/reference/events-that-trigger-workflows
on: [push, pull_request]
jobs:
clippy_check:
Expand Down Expand Up @@ -30,7 +31,7 @@ jobs:
- name: Install node
uses: actions/setup-node@v3
with:
node-version: 14
node-version: 18
- name: Install node packages
working-directory: ./web_frontend
run: npm i
Expand All @@ -40,11 +41,10 @@ jobs:
- name: Build web frontend
run: trunk build
working-directory: ./web_frontend
- name: Build backend
run: cargo build
working-directory: .

- uses: actions-rs/clippy-check@v1
with:
token: ${{ secrets.GITHUB_TOKEN }}
args: --all-features

rustfmt:
name: Check style
Expand All @@ -68,7 +68,7 @@ jobs:
args: --all -- --check

ci:
name: CI
name: Build
runs-on: ${{ matrix.os }}
strategy:
matrix:
Expand All @@ -81,26 +81,14 @@ jobs:
os: ubuntu-latest
rust: stable
target: aarch64-unknown-linux-gnu
# - build: macos
# os: macos-latest
# rust: stable
# target: x86_64-apple-darwin
# - buid: macos
# os: macos-latest
# rust: stable
# target: aarch64-apple-darwin
- build: windows
os: windows-latest
rust: stable
target: x86_64-pc-windows-msvc
steps:
- name: Checkout
uses: actions/checkout@v2

- name: Cache build artifacts
uses: actions/cache@v3
with:
key: no_gui-${{ matrix.os }}-${{ matrix.target }}-artifacts
key: ${{ matrix.os }}-${{ matrix.target }}-artifacts
path: |
./target
~/.cargo
Expand All @@ -114,122 +102,33 @@ jobs:

- name: Install rust target
run: rustup target add ${{ matrix.target }}

- name: Install cross build dependencies
if: matrix.target == 'aarch64-unknown-linux-gnu'
run: sudo apt-get update && sudo apt-get install -y gcc-aarch64-linux-gnu libc6-dev-arm64-cross

- name: Install node
uses: actions/setup-node@v3
with:
node-version: 18
- name: Install node packages
working-directory: ./web_frontend
run: npm i
- name: Install trunk
uses: actions-rs/cargo@v1
with:
command: install
args: --locked --debug trunk
- name: Build web frontend
run: rustup target add wasm32-unknown-unknown && trunk build --release
working-directory: ./web_frontend
- name: Build server
uses: actions-rs/cargo@v1
with:
command: build
working-directory: .
args: --release --target ${{ matrix.target }} --bin privaxy --target-dir target

- uses: actions/upload-artifact@v3
if: matrix.os != 'windows-latest'
with:
name: privaxy_nogui-${{ matrix.target }}
name: privaxy-${{ matrix.target }}
path: |
target/${{ matrix.target }}/release/privaxy

- uses: actions/upload-artifact@v3
if: matrix.os == 'windows-latest'
with:
name: privaxy_nogui-${{ matrix.target }}
path: |
target/${{ matrix.target }}/release/privaxy.exe

ci_desktop:
name: CI Desktop
runs-on: ${{ matrix.os }}
strategy:
matrix:
include:
- build: linux
os: ubuntu-latest
rust: stable
# - build: macos
# os: macos-latest
# rust: stable
- build: windows
os: windows-latest
rust: stable
steps:
- name: Checkout
uses: actions/checkout@v2

- name: Cache build artifacts
uses: actions/cache@v3
with:
key: gui-${{ matrix.os }}-artifacts
path: |
./target
~/.cargo

- name: Install rust
uses: actions-rs/toolchain@v1
with:
toolchain: ${{ matrix.rust }}
profile: minimal
override: true

- name: Install trunk
uses: actions-rs/cargo@v1
with:
command: install
args: --locked --debug trunk

- name: Install webassembly rust target
run: rustup target add wasm32-unknown-unknown

# Required for tailwindcss
- name: Install node
uses: actions/setup-node@v3
with:
node-version: 16

- if: startsWith(matrix.os, 'ubuntu') == true
name: Install gui library packages
run: sudo apt-get update && sudo apt-get install -y libwebkit2gtk-4.0-dev build-essential libayatana-appindicator3-dev librsvg2-dev libgtk-3-dev libsoup2.4-dev libjavascriptcoregtk-4.0-dev

- if: startsWith(matrix.os, 'macos') == true
name: Install rust apple arm target
run: rustup target add aarch64-apple-darwin

- if: startsWith(matrix.os, 'macos') == true
name: Install apple api key private key
run: |
mkdir -p ~/private_keys
echo "$API_KEY" >> ~/private_keys/AuthKey_"$API_KEY_ID".p8
shell: bash
env:
API_KEY: ${{secrets.APPLE_API_KEY_CONTENTS}}
API_KEY_ID: ${{secrets.APPLE_API_KEY}}

- name: Install node packages
working-directory: ./web_frontend
run: npm i
# It is required to first build the frontend as the server won't
# build if it has no access to frontend's dist directory.
- name: Build web frontend
run: trunk build --release
working-directory: ./web_frontend

- name: Build desktop app
id: desktop_app
uses: tauri-apps/tauri-action@5a6072a9edbbf71718caee364b5b96731d7580fc #v0 does not handle universal builds
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
ENABLE_CODE_SIGNING: ${{ secrets.APPLE_CERTIFICATE }}
APPLE_CERTIFICATE: ${{ secrets.APPLE_CERTIFICATE }}
APPLE_CERTIFICATE_PASSWORD: ${{ secrets.APPLE_CERTIFICATE_PASSWORD }}
APPLE_SIGNING_IDENTITY: ${{ secrets.APPLE_SIGNING_IDENTITY }}
APPLE_API_ISSUER: ${{ secrets.APPLE_API_ISSUER }}
APPLE_API_KEY: ${{ secrets.APPLE_API_KEY }}
with:
tagName: privaxy-v__VERSION__ # the action automatically replaces \_\_VERSION\_\_ with the app version
releaseName: 'Privaxy v__VERSION__'
releaseBody: 'See the assets to download this version and install.'
releaseDraft: true
prerelease: false
args: ${{ startsWith(matrix.os, 'macos') == true && '--target universal-apple-darwin' || '' }}
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,4 @@ web_frontend/dist
filters/__pycache__
node_modules
.vscode
**/target/*
Loading
Loading