Compare commits

..

No commits in common. "c3d7a9fee48d42a94ea57af4aae253f7c4274473" and "18d4e1ea28b425c7e66e0f4c8021aeae520bd850" have entirely different histories.

2 changed files with 25 additions and 70 deletions

View File

@ -13,24 +13,8 @@ on:
- latest
- v*.*.*
jobs:
# Include arm64 if ref is a tag
setup-matrix:
runs-on: ubuntu-latest
outputs:
matrix: ${{ steps.set-matrix.outputs.matrix }}
steps:
- name: Set up matrix
id: set-matrix
run: |
if [[ "${{ github.ref }}" == "refs/tags/"* ]]; then
echo "matrix=[\"ubuntu-latest\", \"arm64\"]" >> $GITHUB_OUTPUT
else
echo "matrix=[\"ubuntu-latest\"]" >> $GITHUB_OUTPUT
fi
tarball:
runs-on: ubuntu-latest
needs: [setup-matrix]
steps:
- uses: pnpm/action-setup@v2
with:
@ -54,13 +38,8 @@ jobs:
gp/.build/tarball/*.tar.gz
build-deb:
needs:
- setup-matrix
- tarball
strategy:
matrix:
os: ${{fromJson(needs.setup-matrix.outputs.matrix)}}
runs-on: ${{ matrix.os }}
runs-on: ubuntu-latest
needs: [tarball]
container:
image: yuezk/gpdev:main
credentials:
@ -89,19 +68,14 @@ jobs:
- name: Upload DEB package
uses: actions/upload-artifact@v3
with:
name: artifact-deb-${{ matrix.os }}
name: artifact-deb
if-no-files-found: error
path: |
globalprotect-openconnect-*/.build/deb/*.deb
build-rpm:
needs:
- setup-matrix
- tarball
strategy:
matrix:
os: ${{fromJson(needs.setup-matrix.outputs.matrix)}}
runs-on: ${{ matrix.os }}
runs-on: ubuntu-latest
needs: [tarball]
container:
image: yuezk/gpdev:rpm-builder
credentials:
@ -132,19 +106,14 @@ jobs:
- name: Upload RPM package
uses: actions/upload-artifact@v3
with:
name: artifact-rpm-${{ matrix.os }}
name: artifact-rpm
if-no-files-found: error
path: |
globalprotect-openconnect-*/.build/rpm/*.rpm
build-pkgbuild:
needs:
- setup-matrix
- tarball
strategy:
matrix:
os: ${{fromJson(needs.setup-matrix.outputs.matrix)}}
runs-on: ${{ matrix.os }}
runs-on: ubuntu-latest
needs: [tarball]
container:
image: yuezk/gpdev:pkgbuild
credentials:
@ -173,19 +142,14 @@ jobs:
- name: Upload PKGBUILD package
uses: actions/upload-artifact@v3
with:
name: artifact-pkgbuild-${{ matrix.os }}
name: artifact-pkgbuild
if-no-files-found: error
path: |
globalprotect-openconnect-*/.build/pkgbuild/*.pkg.tar.zst
build-binary:
needs:
- setup-matrix
- tarball
strategy:
matrix:
os: ${{fromJson(needs.setup-matrix.outputs.matrix)}}
runs-on: ${{ matrix.os }}
runs-on: ubuntu-latest
needs: [tarball]
container:
image: yuezk/gpdev:main
credentials:
@ -215,18 +179,13 @@ jobs:
- name: Upload binary
uses: actions/upload-artifact@v3
with:
name: artifact-binary-${{ matrix.os }}
name: artifact-binary
if-no-files-found: error
path: |
globalprotect-openconnect-*/.build/binary/*.bin.tar.xz*
build-gpgui:
needs:
- setup-matrix
strategy:
matrix:
os: ${{fromJson(needs.setup-matrix.outputs.matrix)}}
runs-on: ${{ matrix.os }}
runs-on: ubuntu-latest
container:
image: yuezk/gpdev:main
credentials:
@ -257,13 +216,13 @@ jobs:
- name: Upload gpgui
uses: actions/upload-artifact@v3
with:
name: artifact-gpgui-${{ matrix.os }}
name: artifact-gpgui
if-no-files-found: error
path: |
gpgui/.build/package/*.tar.xz*
gh-release:
if: startsWith(github.ref, 'refs/tags/')
# if: startsWith(github.ref, 'refs/tags/')
runs-on: ubuntu-latest
needs:
- build-deb
@ -282,12 +241,13 @@ jobs:
uses: softprops/action-gh-release@v1
with:
token: ${{ secrets.GH_PAT }}
prerelease: ${{ contains(github.ref, 'latest') }}
# prerelease: ${{ contains(github.ref, 'latest') }}
prerelease: true
fail_on_unmatched_files: true
files: |
artifact/artifact-*/globalprotect-openconnect-*/.build/deb/*.deb
artifact/artifact-*/globalprotect-openconnect-*/.build/rpm/*.rpm
artifact/artifact-*/globalprotect-openconnect-*/.build/pkgbuild/*.pkg.tar.zst
artifact/artifact-*/globalprotect-openconnect-*/.build/binary/*.bin.tar.xz*
artifact/artifact-*/*.bin.tar.xz*
artifact/artifact-*/*.tar.gz
artifact/**/*.deb
artifact/**/*.rpm
artifact/**/*.pkg.tar.zst
artifact/**/*.bin.tar.xz
artifact/**/*.tar.gz
artifact/**/*.sha256

View File

@ -80,19 +80,14 @@ impl GuiUpdater {
pub async fn update(&self) {
info!("Update GUI, version: {}", self.version);
#[cfg(debug_assertions)]
let release_tag = "latest";
#[cfg(not(debug_assertions))]
let release_tag = format!("v{}", self.version);
#[cfg(target_arch = "x86_64")]
let arch = "x86_64";
#[cfg(target_arch = "aarch64")]
let arch = "aarch64";
let file_url = format!(
"https://github.com/yuezk/GlobalProtect-openconnect/releases/download/{}/gpgui_{}_{}.bin.tar.xz",
release_tag, self.version, arch
"https://github.com/yuezk/GlobalProtect-openconnect/releases/download/v{}/gpgui_{}_{}.bin.tar.xz",
self.version, self.version, arch
);
let checksum_url = format!("{}.sha256", file_url);