-
-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
move pre/post command functionality to client (#331)
* move command functionality to client * fix builds * fix linter * update workflow
- Loading branch information
1 parent
0c55e87
commit 6a453cf
Showing
7 changed files
with
112 additions
and
88 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
name: "Build app & create release" | ||
name: 'Build app and create release' | ||
on: | ||
push: | ||
tags: | ||
|
@@ -18,9 +18,9 @@ jobs: | |
ref: master | ||
fetch-depth: 0 | ||
- name: Set up Go | ||
uses: actions/setup-go@v4 | ||
uses: actions/setup-go@v5 | ||
with: | ||
go-version: '1.20' | ||
go-version: '1.22' | ||
- name: Build wireguard-go binary | ||
run: make | ||
env: | ||
|
@@ -56,21 +56,33 @@ jobs: | |
runs-on: | ||
- self-hosted | ||
- Linux | ||
- ${{ matrix.architecture }} | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
architecture: [ARM64, X64] | ||
include: | ||
- architecture: ARM64 | ||
deb_arch: arm64 | ||
binary_arch: aarch64 | ||
- architecture: X64 | ||
deb_arch: amd64 | ||
binary_arch: x86_64 | ||
steps: | ||
- uses: actions/checkout@v4 | ||
with: | ||
submodules: "recursive" | ||
submodules: 'recursive' | ||
- name: Write release version | ||
run: | | ||
VERSION=$(echo ${GITHUB_REF_NAME#v} | cut -d '-' -f1) | ||
echo Version: $VERSION | ||
echo "VERSION=$VERSION" >> $GITHUB_ENV | ||
- uses: actions/setup-node@v3 | ||
with: | ||
node-version: "20" | ||
node-version: '20' | ||
- uses: pnpm/action-setup@v2 | ||
with: | ||
version: 8 | ||
version: 9 | ||
run_install: false | ||
- name: Get pnpm store directory | ||
shell: bash | ||
|
@@ -83,13 +95,13 @@ jobs: | |
key: ${{ runner.os }}-pnpm-build-store-${{ hashFiles('**/pnpm-lock.yaml') }} | ||
restore-keys: | | ||
${{ runner.os }}-pnpm-build-store- | ||
- name: Install deps | ||
- name: Install Node dependencies | ||
run: pnpm install --frozen-lockfile | ||
- uses: dtolnay/rust-toolchain@stable | ||
- name: install linux deps | ||
- name: Install Linux dependencies | ||
run: | | ||
sudo apt-get update | ||
sudo apt-get install -y libgtk-3-dev libwebkit2gtk-4.0-dev libappindicator3-dev librsvg2-dev patchelf libssl-dev unzip | ||
sudo apt-get install -y libgtk-3-dev libwebkit2gtk-4.0-dev libappindicator3-dev librsvg2-dev patchelf libssl-dev unzip protobuf-compiler libprotobuf-dev | ||
- name: Build packages | ||
uses: tauri-apps/tauri-action@v0 | ||
env: | ||
|
@@ -100,53 +112,44 @@ jobs: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
with: | ||
upload_url: ${{ needs.create-release.outputs.upload_url }} | ||
asset_path: src-tauri/target/release/bundle/deb/defguard-client_${{ env.VERSION }}_amd64.deb | ||
asset_name: defguard-client_${{ env.VERSION }}_amd64.deb | ||
asset_content_type: application/octet-stream | ||
- name: Upload AppImage | ||
uses: actions/[email protected] | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
with: | ||
upload_url: ${{ needs.create-release.outputs.upload_url }} | ||
asset_path: src-tauri/target/release/bundle/appimage/defguard-client_${{ env.VERSION }}_amd64.AppImage | ||
asset_name: defguard-client_${{ env.VERSION }}_amd64.AppImage | ||
asset_path: src-tauri/target/release/bundle/deb/defguard-client_${{ env.VERSION }}_${{ matrix.deb_arch }}.deb | ||
asset_name: defguard-client_${{ env.VERSION }}_${{ matrix.deb_arch }}.deb | ||
asset_content_type: application/octet-stream | ||
- name: Rename client binary | ||
run: mv src-tauri/target/release/defguard-client defguard-client-linux-x86_64-${{ github.ref_name }} | ||
run: mv src-tauri/target/release/defguard-client defguard-client-linux-${{ matrix.binary_arch }}-${{ github.ref_name }} | ||
- name: Tar client binary | ||
uses: a7ul/[email protected] | ||
with: | ||
command: c | ||
files: | | ||
defguard-client-linux-x86_64-${{ github.ref_name }} | ||
outPath: defguard-client-linux-x86_64-${{ github.ref_name }}.tar.gz | ||
defguard-client-linux-${{ matrix.binary_arch }}-${{ github.ref_name }} | ||
outPath: defguard-client-linux-${{ matrix.binary_arch }}-${{ github.ref_name }}.tar.gz | ||
- name: Upload client archive | ||
uses: actions/[email protected] | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
with: | ||
upload_url: ${{ needs.create-release.outputs.upload_url }} | ||
asset_path: defguard-client-linux-x86_64-${{ github.ref_name }}.tar.gz | ||
asset_name: defguard-client-linux-x86_64-${{ github.ref_name }}.tar.gz | ||
asset_path: defguard-client-linux-${{ matrix.binary_arch }}-${{ github.ref_name }}.tar.gz | ||
asset_name: defguard-client-linux-${{ matrix.binary_arch }}-${{ github.ref_name }}.tar.gz | ||
asset_content_type: application/octet-stream | ||
- name: Rename daemon binary | ||
run: mv src-tauri/target/release/defguard-service defguard-service-linux-x86_64-${{ github.ref_name }} | ||
run: mv src-tauri/target/release/defguard-service defguard-service-linux-${{ matrix.binary_arch }}-${{ github.ref_name }} | ||
- name: Tar daemon binary | ||
uses: a7ul/[email protected] | ||
with: | ||
command: c | ||
files: | | ||
defguard-service-linux-x86_64-${{ github.ref_name }} | ||
outPath: defguard-service-linux-x86_64-${{ github.ref_name }}.tar.gz | ||
defguard-service-linux-${{ matrix.binary_arch }}-${{ github.ref_name }} | ||
outPath: defguard-service-linux-${{ matrix.binary_arch }}-${{ github.ref_name }}.tar.gz | ||
- name: Upload daemon archive | ||
uses: actions/[email protected] | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
with: | ||
upload_url: ${{ needs.create-release.outputs.upload_url }} | ||
asset_path: defguard-service-linux-x86_64-${{ github.ref_name }}.tar.gz | ||
asset_name: defguard-service-linux-x86_64-${{ github.ref_name }}.tar.gz | ||
asset_path: defguard-service-linux-${{ matrix.binary_arch }}-${{ github.ref_name }}.tar.gz | ||
asset_name: defguard-service-linux-${{ matrix.binary_arch }}-${{ github.ref_name }}.tar.gz | ||
asset_content_type: application/octet-stream | ||
build-macos: | ||
needs: | ||
|
@@ -162,18 +165,18 @@ jobs: | |
steps: | ||
- uses: actions/checkout@v4 | ||
with: | ||
submodules: "recursive" | ||
submodules: 'recursive' | ||
- name: Write release version | ||
run: | | ||
VERSION=$(echo ${GITHUB_REF_NAME#v} | cut -d '-' -f1) | ||
echo Version: $VERSION | ||
echo "VERSION=$VERSION" >> $GITHUB_ENV | ||
- uses: actions/setup-node@v3 | ||
with: | ||
node-version: "20" | ||
node-version: '20' | ||
- uses: pnpm/action-setup@v2 | ||
with: | ||
version: 8 | ||
version: 9 | ||
run_install: false | ||
- name: Get pnpm store directory | ||
shell: bash | ||
|
@@ -203,12 +206,12 @@ jobs: | |
uses: tauri-apps/tauri-action@v0 | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
APPLE_SIGNING_IDENTITY: "Developer ID Application: TEONITE (6WD6W6WQNV)" | ||
APPLE_SIGNING_IDENTITY: 'Developer ID Application: TEONITE (6WD6W6WQNV)' | ||
APPLE_CERTIFICATE: ${{ secrets.APPLE_CERTIFICATE }} | ||
APPLE_CERTIFICATE_PASSWORD: ${{ secrets.APPLE_CERTIFICATE_PASSWORD }} | ||
APPLE_ID: "[email protected]" | ||
APPLE_ID: '[email protected]' | ||
APPLE_PASSWORD: ${{ secrets.NOTARYTOOL_APP_SPECIFIC_PASSWORD }} | ||
APPLE_TEAM_ID: "6WD6W6WQNV" | ||
APPLE_TEAM_ID: '6WD6W6WQNV' | ||
with: | ||
args: --target ${{ matrix.target }} -v | ||
- name: Build installation package | ||
|
@@ -240,18 +243,18 @@ jobs: | |
steps: | ||
- uses: actions/checkout@v4 | ||
with: | ||
submodules: "recursive" | ||
submodules: 'recursive' | ||
- name: Write release version | ||
run: | | ||
$env:VERSION=echo ($env:GITHUB_REF_NAME.Substring(1) -Split "-")[0] | ||
echo Version: $env:VERSION | ||
echo "VERSION=$env:VERSION" >> $env:GITHUB_ENV | ||
- uses: actions/setup-node@v3 | ||
with: | ||
node-version: "20" | ||
node-version: '20' | ||
- uses: pnpm/action-setup@v2 | ||
with: | ||
version: 8 | ||
version: 9 | ||
run_install: false | ||
- name: Get pnpm store directory | ||
shell: bash | ||
|
@@ -299,6 +302,7 @@ jobs: | |
runs-on: | ||
- self-hosted | ||
- Linux | ||
- X64 | ||
steps: | ||
- name: Write release version | ||
run: | | ||
|
@@ -323,7 +327,7 @@ jobs: | |
- sign-burn-engine | ||
runs-on: windows-latest | ||
steps: | ||
- name: Download unsigned bundle & signed burn-engine | ||
- name: Download unsigned bundle and signed burn-engine | ||
uses: actions/download-artifact@v4 | ||
with: | ||
name: unsigned-bundle-and-signed-burnengine | ||
|
@@ -346,6 +350,7 @@ jobs: | |
runs-on: | ||
- self-hosted | ||
- Linux | ||
- X64 | ||
steps: | ||
- name: Write release version | ||
run: | | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.