diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index 2b33a885..60ccb6db 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -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,10 +56,22 @@ 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) @@ -67,10 +79,10 @@ jobs: 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/upload-release-asset@v1.0.2 - 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/tar-action@v1.1.0 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/upload-release-asset@v1.0.2 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/tar-action@v1.1.0 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/upload-release-asset@v1.0.2 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,7 +165,7 @@ 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) @@ -170,10 +173,10 @@ jobs: 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: "admin@teonite.com" + APPLE_ID: 'admin@teonite.com' 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,7 +243,7 @@ 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] @@ -248,10 +251,10 @@ jobs: 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: | diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 6191064b..90c8b0b9 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -6,22 +6,22 @@ on: - main - dev paths-ignore: - - "*.md" - - "LICENSE" + - '*.md' + - 'LICENSE' pull_request: branches: - main - dev paths-ignore: - - "*.md" - - "LICENSE" + - '*.md' + - 'LICENSE' env: CARGO_TERM_COLOR: always jobs: test: - runs-on: [self-hosted, Linux] + runs-on: [self-hosted, Linux, X64] container: rust:1.74 defaults: run: