From 9b180ad90c810f7ae0052609a6a616c52ebc03db Mon Sep 17 00:00:00 2001 From: Kevin Yue Date: Fri, 18 Jul 2025 15:33:30 +0800 Subject: [PATCH] feat: add Publish PPA workflow and support for disabling Rust toolchain --- .../{publish.yaml => publish-ppa.yaml} | 34 +++++++++---------- Makefile | 6 ++++ packaging/deb/rules.in | 1 + 3 files changed, 24 insertions(+), 17 deletions(-) rename .github/workflows/{publish.yaml => publish-ppa.yaml} (80%) diff --git a/.github/workflows/publish.yaml b/.github/workflows/publish-ppa.yaml similarity index 80% rename from .github/workflows/publish.yaml rename to .github/workflows/publish-ppa.yaml index 69d1334..9934dd1 100644 --- a/.github/workflows/publish.yaml +++ b/.github/workflows/publish-ppa.yaml @@ -1,4 +1,4 @@ -name: Publish Packages +name: Publish PPA on: workflow_dispatch: @@ -8,24 +8,18 @@ on: required: true revision: description: 'Package revision' - required: true + required: false default: "1" - ppa: - description: 'Publish to PPA' - type: boolean + series: + description: 'Ubuntu series to publish' + type: "string" + required: false + default: "" + rust: + description: 'Rust version to use' + type: "string" required: true - default: true - obs: - description: 'Publish to OBS' - type: boolean - required: true - default: true - aur: - description: 'Publish to AUR' - type: boolean - required: true - default: true - + default: "1.82" jobs: check: runs-on: ubuntu-latest @@ -84,6 +78,11 @@ jobs: sed -i "s/@OFFLINE@/1/g" .build/debian/rules sed -i "s/@BUILD_GUI@/1/g" .build/debian/rules + # Update the control file with the correct Rust version + sed -i "s/rust-[0-9.]\+-all/rust-${{ inputs.rust }}-all/g" .build/debian/control + sed -i "s/rust-[0-9.]\+/rust-${{ inputs.rust }}/g" .build/debian/rules + sed -i "s/DISABLE_RUST_TOOLCHAIN = 0/DISABLE_RUST_TOOLCHAIN = 1/g" .build/debian/rules + - name: Publish to PPA uses: yuezk/publish-ppa-package@gp with: @@ -97,4 +96,5 @@ jobs: extra_ppa: "yuezk/globalprotect-openconnect" # Ubuntu 18.04 and 20.04 are excluded because tauri2 no longer supports them excluded_series: "bionic focal" + series: ${{ inputs.series }} revision: ${{ inputs.revision }} diff --git a/Makefile b/Makefile index 22ecfed..65b1d06 100644 --- a/Makefile +++ b/Makefile @@ -4,6 +4,7 @@ OFFLINE ?= 0 BUILD_FE ?= 1 INCLUDE_GUI ?= 0 CARGO ?= cargo +DISABLE_RUST_TOOLCHAIN ?= 0 VERSION = $(shell $(CARGO) metadata --no-deps --format-version 1 | jq -r '.packages[0].version') REVISION ?= 1 @@ -101,6 +102,11 @@ build-rs: tar -xJf vendor.tar.xz; \ fi + # Remove the rust-toolchain.toml if DISABLE_RUST_TOOLCHAIN is set to 1 + if [ $(DISABLE_RUST_TOOLCHAIN) -eq 1 ]; then \ + rm -vf rust-toolchain.toml; \ + fi + # Only build the GUI components if BUILD_GUI is set to 1 if [ $(BUILD_GUI) -eq 1 ]; then \ $(CARGO) build $(CARGO_BUILD_ARGS) -p gpclient -p gpservice -p gpauth; \ diff --git a/packaging/deb/rules.in b/packaging/deb/rules.in index 591d12f..2ca7a71 100755 --- a/packaging/deb/rules.in +++ b/packaging/deb/rules.in @@ -3,6 +3,7 @@ export OFFLINE = @OFFLINE@ export BUILD_FE = 0 export BUILD_GUI = @BUILD_GUI@ +export DISABLE_RUST_TOOLCHAIN = 0 export PATH := /usr/lib/rust-1.82/bin:$(PATH)