Skip to content

Commit

Permalink
Build Cloak PT plugin for Desktop
Browse files Browse the repository at this point in the history
[cloak]
  • Loading branch information
outspace committed Nov 13, 2023
1 parent 5211785 commit 430ab69
Showing 1 changed file with 59 additions and 12 deletions.
71 changes: 59 additions & 12 deletions .github/workflows/build_cloak.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,14 @@ on: [push]

jobs:

Build-Libs-Cloak-Windows:
name: 'Build-Libs-Cloak-Windows'
Build-Cloak:
name: 'Build-Cloak'
runs-on: ubuntu-latest
if: |
contains(github.event.head_commit.message, '[all]') ||
contains(github.event.head_commit.message, '[windows]') ||
contains(github.event.head_commit.message, '[linux]') ||
contains(github.event.head_commit.message, '[macos]') ||
contains(github.event.head_commit.message, '[cloak]')
steps:
Expand All @@ -34,46 +35,92 @@ jobs:
uses: actions/checkout@v3
with:
repository: amnezia-vpn/Cloak
ref: master-amnezia
path: windows/Cloak
ref: 28890e1c69e0b02b052fe6e438f5c3642137ab7a
path: Cloak

- name: 'Build Cloak binary'
working-directory: windows/Cloak
working-directory: Cloak
run: |
export PATH=${PATH}:`go env GOPATH`/bin
v=${GITHUB_REF#refs/*/} ./release.sh
- name: 'Build desktop Cloak plugin'
working-directory: Cloak
run: |
sudo apt-get install gcc-mingw-w64
mkdir ./release/plugin
mkdir ./release/plugin/linux
CGO_ENABLED=1 GOOS="linux" GOARCH="amd64" go build -v -o ./release/plugin/linux/ck-ovpn-plugin.a -buildmode=c-archive ./cmd/ck-ovpn-plugin/
mkdir ./release/plugin/windows
CGO_ENABLED=1 CC=x86_64-w64-mingw32-gcc GOOS="windows" GOARCH="amd64" go build -v -o ./release/plugin/windows/ck-ovpn-plugin.dll -buildmode=c-shared ./cmd/ck-ovpn-plugin/
- name: Archive Linux client binary
uses: actions/upload-artifact@v3
with:
retention-days: 1
name: ck-client-linux
path: '~/work/3rd-build-ga/3rd-build-ga/windows/Cloak/release/ck-client-linux*'
path: '~/work/3rd-build-ga/3rd-build-ga/Cloak/release/ck-client-linux*'

- name: Archive Windows client binary
uses: actions/upload-artifact@v3
with:
retention-days: 1
name: ck-client-windows
path: '~/work/3rd-build-ga/3rd-build-ga/windows/Cloak/release/ck-client-windows*'
path: '~/work/3rd-build-ga/3rd-build-ga/Cloak/release/ck-client-windows*'

- name: Archive Darwin client binary
uses: actions/upload-artifact@v3
with:
retention-days: 1
name: ck-client-darwin
path: '~/work/3rd-build-ga/3rd-build-ga/windows/Cloak/release/ck-client-darwin*'
path: '~/work/3rd-build-ga/3rd-build-ga/Cloak/release/ck-client-darwin*'

- name: Archive Linux server binary
uses: actions/upload-artifact@v3
with:
retention-days: 1
name: ck-server
path: '~/work/3rd-build-ga/3rd-build-ga/windows/Cloak/release/ck-server-linux*'
path: '~/work/3rd-build-ga/3rd-build-ga/Cloak/release/ck-server-linux*'

- name: Archive Plugin
uses: actions/upload-artifact@v3
with:
retention-days: 1
name: desktop-plugin
path: '~/work/3rd-build-ga/3rd-build-ga/Cloak/release/plugin'

Build-Cloak-MacOS:

runs-on: macos-12
if: |
contains(github.event.head_commit.message, '[all]') ||
contains(github.event.head_commit.message, '[macos]') ||
contains(github.event.head_commit.message, '[cloak]')
name: "Build Cloak Desktop plugin"
steps:

- name: Get Cloak
uses: actions/checkout@v3
with:
repository: amnezia-vpn/Cloak
ref: 28890e1c69e0b02b052fe6e438f5c3642137ab7a
path: Cloak

- name: 'Run build script'
working-directory: Cloak
run: |
CGO_ENABLED=1 GOOS="darwin" GOARCH="amd64" go build -v -o ./release/plugin/darwin/ck-ovpn-plugin.a -buildmode=c-archive ./cmd/ck-ovpn-plugin/
- name: Archive artifacts
uses: actions/upload-artifact@v3
with:
name: darwin-pt
path: Cloak/release/plugin

github-release:
name: GitHub Release
needs: Build-Libs-Cloak-Windows
needs: Build-Cloak
runs-on: ubuntu-latest
if: startsWith(github.ref, 'refs/tags/')

Expand All @@ -85,7 +132,7 @@ jobs:
uses: actions/download-artifact@v2

- name: Setup | Checksums
run: for file in $(find ./ -name 'ck-*' ); do openssl dgst -sha256 -r "$file" | awk '{print $1}' > "${file}.sha256"; done
run: for file in $(find ./ -name '*' ); do openssl dgst -sha256 -r "$file" | awk '{print $1}' > "${file}.sha256"; done

- name: Zip ALL
run: for file in *; do zip -r ${file%.*}.zip $file; done
Expand Down

0 comments on commit 430ab69

Please sign in to comment.