Skip to content

Commit

Permalink
upgrade gpauth
Browse files Browse the repository at this point in the history
  • Loading branch information
yuezk committed Dec 24, 2024
1 parent 32cb582 commit b5064ef
Show file tree
Hide file tree
Showing 62 changed files with 4,301 additions and 6,466 deletions.
59 changes: 38 additions & 21 deletions .devcontainer/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM ubuntu:18.04
FROM ubuntu:22.04

ARG USERNAME=vscode
ARG USER_UID=1000
Expand All @@ -7,8 +7,9 @@ ARG USER_GID=$USER_UID
ENV RUSTUP_HOME=/usr/local/rustup \
CARGO_HOME=/usr/local/cargo \
PATH=/usr/local/cargo/bin:$PATH \
RUST_VERSION=1.75.0
RUST_VERSION=1.80.0

# Install common dependencies
RUN set -eux; \
apt-get update; \
apt-get install -y --no-install-recommends \
Expand All @@ -18,34 +19,50 @@ RUN set -eux; \
gnupg \
git \
less \
software-properties-common \
# Tauri dependencies
libwebkit2gtk-4.0-dev build-essential wget libssl-dev libgtk-3-dev libayatana-appindicator3-dev librsvg2-dev; \
# Install openconnect
add-apt-repository ppa:yuezk/globalprotect-openconnect; \
apt-get update; \
apt-get install -y openconnect libopenconnect-dev; \
# Create a non-root user
software-properties-common

# Create a non-root user
RUN set -eux; \
groupadd --gid $USER_GID $USERNAME; \
useradd --uid $USER_UID --gid $USER_GID -m $USERNAME; \
echo $USERNAME ALL=\(root\) NOPASSWD:ALL > /etc/sudoers.d/$USERNAME; \
chmod 0440 /etc/sudoers.d/$USERNAME; \
# Install Node.js
mkdir -p /etc/apt/keyrings; \
curl -fsSL https://deb.nodesource.com/gpgkey/nodesource-repo.gpg.key | gpg --dearmor -o /etc/apt/keyrings/nodesource.gpg; \
echo "deb [signed-by=/etc/apt/keyrings/nodesource.gpg] https://deb.nodesource.com/node_16.x nodistro main" | tee /etc/apt/sources.list.d/nodesource.list; \
apt-get update; \
apt-get install -y nodejs; \
corepack enable; \
# Install diff-so-fancy
npm install -g diff-so-fancy; \
# Install Rust
chmod 0440 /etc/sudoers.d/$USERNAME

# Install Rust
RUN set -eux; \
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y --default-toolchain $RUST_VERSION; \
chown -R $USERNAME:$USERNAME $RUSTUP_HOME $CARGO_HOME; \
rustup --version; \
cargo --version; \
rustc --version

# Install Node.js
RUN set -eux; \
curl -fsSL https://deb.nodesource.com/setup_20.x | bash -; \
apt-get install -y nodejs; \
corepack enable; \
# Install diff-so-fancy
npm install -g diff-so-fancy

# Install openconnect
RUN set -eux; \
add-apt-repository ppa:yuezk/globalprotect-openconnect; \
apt-get update; \
apt-get install -y openconnect libopenconnect-dev

# Tauri dependencies
RUN set -eux; \
apt-get install -y \
libwebkit2gtk-4.1-dev \
build-essential \
curl \
wget \
file \
libxdo-dev \
libssl-dev \
libayatana-appindicator3-dev \
librsvg2-dev

USER $USERNAME

# Install Oh My Zsh
Expand Down
37 changes: 19 additions & 18 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,8 @@ jobs:
- name: Set up matrix
id: set-matrix
run: |
if [[ "${{ github.ref }}" == "refs/tags/"* ]]; then
# Set the matrix to include arm64 if the ref is a tag or is the dev branch
if [[ "${{ github.ref }}" == "refs/tags/"* || "${{ github.ref }}" == "refs/heads/dev" ]]; then
echo 'matrix=[{"runner": "ubuntu-latest", "arch": "amd64"}, {"runner": "arm64", "arch": "arm64"}]' >> $GITHUB_OUTPUT
else
echo 'matrix=[{"runner": "ubuntu-latest", "arch": "amd64"}]' >> $GITHUB_OUTPUT
Expand All @@ -34,13 +35,13 @@ jobs:
runs-on: ubuntu-latest
needs: [setup-matrix]
steps:
- uses: pnpm/action-setup@v2
- uses: pnpm/action-setup@v4
with:
version: 8
version: 9
- name: Prepare workspace
run: rm -rf source && mkdir source
- name: Checkout GlobalProtect-openconnect
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
token: ${{ secrets.GH_PAT }}
repository: yuezk/GlobalProtect-openconnect
Expand All @@ -55,7 +56,7 @@ jobs:
fi
make tarball
- name: Upload tarball
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: artifact-source
if-no-files-found: error
Expand All @@ -79,7 +80,7 @@ jobs:
rm -rf build-gp-${{ matrix.package }}
mkdir -p build-gp-${{ matrix.package }}
- name: Download tarball
uses: actions/download-artifact@v3
uses: actions/download-artifact@v4
with:
name: artifact-source
path: build-gp-${{ matrix.package }}
Expand All @@ -89,16 +90,16 @@ jobs:
run: |
docker run --rm \
-v $(pwd)/build-gp-${{ matrix.package }}:/${{ matrix.package }} \
yuezk/gpdev:${{ matrix.package }}-builder
yuezk/gpdev:${{ matrix.package }}-builder-tauri2
- name: Install ${{ matrix.package }} package in Docker
run: |
docker run --rm \
-e GPGUI_INSTALLED=0 \
-v $(pwd)/build-gp-${{ matrix.package }}:/${{ matrix.package }} \
yuezk/gpdev:${{ matrix.package }}-builder \
yuezk/gpdev:${{ matrix.package }}-builder-tauri2 \
bash install.sh
- name: Upload ${{ matrix.package }} package
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: artifact-gp-${{ matrix.package }}-${{ matrix.os.arch }}
if-no-files-found: error
Expand All @@ -114,20 +115,20 @@ jobs:
runs-on: ${{ matrix.os.runner }}
name: build-gpgui (${{ matrix.os.arch }})
steps:
- uses: pnpm/action-setup@v2
- uses: pnpm/action-setup@v4
with:
version: 8
version: 9
- name: Prepare workspace
run: rm -rf gpgui-source && mkdir gpgui-source
- name: Checkout GlobalProtect-openconnect
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
token: ${{ secrets.GH_PAT }}
repository: yuezk/GlobalProtect-openconnect
ref: ${{ github.ref }}
path: gpgui-source/gp
- name: Checkout gpgui@${{ github.ref_name }}
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
token: ${{ secrets.GH_PAT }}
repository: yuezk/gpgui
Expand All @@ -141,15 +142,15 @@ jobs:
run: echo ${{ secrets.DOCKER_HUB_TOKEN }} | docker login -u ${{ secrets.DOCKER_HUB_USERNAME }} --password-stdin
- name: Build gpgui in Docker
run: |
docker run --rm -v $(pwd)/gpgui-source:/gpgui yuezk/gpdev:gpgui-builder
docker run --rm -v $(pwd)/gpgui-source:/gpgui yuezk/gpdev:gpgui-builder-tauri2
- name: Install gpgui in Docker
run: |
cd gpgui-source
tar -xJf *.bin.tar.xz
docker run --rm -v $(pwd):/gpgui yuezk/gpdev:gpgui-builder \
docker run --rm -v $(pwd):/gpgui yuezk/gpdev:gpgui-builder-tauri2 \
bash -c "cd /gpgui/gpgui_*/ && ./gpgui --version"
- name: Upload gpgui
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: artifact-gpgui-${{ matrix.os.arch }}
if-no-files-found: error
Expand All @@ -170,15 +171,15 @@ jobs:
run: rm -rf gh-release && mkdir gh-release

- name: Checkout GlobalProtect-openconnect
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
token: ${{ secrets.GH_PAT }}
repository: yuezk/GlobalProtect-openconnect
ref: ${{ github.ref }}
path: gh-release/gp

- name: Download all artifacts
uses: actions/download-artifact@v3
uses: actions/download-artifact@v4
with:
path: gh-release/gp/.build/artifacts

Expand Down
12 changes: 7 additions & 5 deletions .github/workflows/publish.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -47,9 +47,9 @@ jobs:
if: ${{ inputs.ppa }}
runs-on: ubuntu-latest
steps:
- uses: pnpm/action-setup@v2
- uses: pnpm/action-setup@v4
with:
version: 8
version: 9
- name: Prepare workspace
run: rm -rf publish-ppa && mkdir publish-ppa
- name: Download ${{ inputs.tag }} source code
Expand All @@ -71,12 +71,12 @@ jobs:
# Prepare the debian directory with custom files
mkdir -p .build/debian
sed 's/@RUST@/rust-all(>=1.70)/g' packaging/deb/control.in > .build/debian/control
sed 's/@RUST@/rust-all(>=1.80)/g' packaging/deb/control.in > .build/debian/control
sed 's/@OFFLINE@/1/g' packaging/deb/rules.in > .build/debian/rules
cp packaging/deb/postrm .build/debian/postrm
- name: Publish to PPA
uses: yuezk/publish-ppa-package@v2
uses: yuezk/publish-ppa-package@gp
with:
repository: "yuezk/globalprotect-openconnect"
gpg_private_key: ${{ secrets.PPA_GPG_PRIVATE_KEY }}
Expand All @@ -85,5 +85,7 @@ jobs:
debian_dir: publish-ppa/globalprotect-openconnect-*/.build/debian
deb_email: "[email protected]"
deb_fullname: "Kevin Yue"
extra_ppa: "yuezk/globalprotect-openconnect liushuyu-011/rust-bpo-1.75"
extra_ppa: "yuezk/globalprotect-openconnect liushuyu-011/rust-updates-1.80"
# Ubuntu 18.04 and 20.04 are excluded because tauri2 no longer supports them
excluded_series: "bionic focal"
revision: ${{ inputs.revision }}
4 changes: 2 additions & 2 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ jobs:
bash install.sh
- name: Upload ${{ matrix.package }} package
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: artifact-${{ matrix.os }}-${{ matrix.package }}
if-no-files-found: error
Expand All @@ -138,7 +138,7 @@ jobs:
- name: Prepare workspace
run: rm -rf gh-release && mkdir gh-release
- name: Download artifact
uses: actions/download-artifact@v3
uses: actions/download-artifact@v4
with:
path: gh-release
- name: Update release
Expand Down
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,6 @@
.cargo
.build
SNAPSHOT

# Tauri generated files
gen
Loading

0 comments on commit b5064ef

Please sign in to comment.