Skip to content

Commit

Permalink
Refactor awg scripts
Browse files Browse the repository at this point in the history
[awg]
  • Loading branch information
albexk committed Feb 12, 2024
1 parent fe09248 commit 84e9f45
Show file tree
Hide file tree
Showing 5 changed files with 168 additions and 174 deletions.
45 changes: 22 additions & 23 deletions .github/workflows/build_awg_android.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ name: android-awg

on: [push]


jobs:

Build-Libs-AWG-Android:
Expand Down Expand Up @@ -35,15 +34,15 @@ jobs:
uses: actions/checkout@v4
with:
repository: amnezia-vpn/amneziawg-android
ref: fix/android
ref: master
path: android/amneziawg-android
submodules: true

- name: 'Build AmneziaWG binary'
working-directory: android/amneziawg-android
run: ./gradlew :tunnel:stripReleaseDebugSymbols

- name: Archive artifacts
- name: 'Archive artifacts'
uses: actions/upload-artifact@v4
with:
name: awg-android
Expand All @@ -56,23 +55,23 @@ jobs:
if: startsWith(github.ref, 'refs/tags/')

steps:
- name: Setup | Checkout
uses: actions/checkout@v4

- name: Setup | Artifacts
uses: actions/download-artifact@v4

- name: Setup | Checksums
run: for file in $(find ./ -name '*.so' ); 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

- name: Upload binaries to release
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: awg-android.zip
tag: ${{ github.ref }}
overwrite: true
file_glob: true
- name: Setup | Checkout
uses: actions/checkout@v4

- name: Setup | Artifacts
uses: actions/download-artifact@v4

- name: Setup | Checksums
run: for file in $(find ./ -name '*.so' ); 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

- name: Upload binaries to release
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: awg-android.zip
tag: ${{ github.ref }}
overwrite: true
file_glob: true
70 changes: 36 additions & 34 deletions .github/workflows/build_awg_ios.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,9 @@ name: awg-ios
on: [push]

jobs:

Build-WG-iOS:
name: 'AmneziaWG for iOS'
runs-on: macos-12
if: |
contains(github.event.head_commit.message, '[all]') ||
Expand All @@ -15,27 +17,27 @@ jobs:
arch: [arm64]

steps:
- name: Install dependencies
run: brew install swiftlint
- name: 'Install dependencies'
run: brew install swiftlint

- name: Get WireGuard
uses: actions/checkout@v3
with:
repository: amnezia-vpn/amneziawg-apple
ref: master
path: awg-apple
- name: 'Get AmneziaWG'
uses: actions/checkout@v4
with:
repository: amnezia-vpn/amneziawg-apple
ref: master
path: awg-apple

- name: Build WG
working-directory: awg-apple/Sources/WireGuardKitGo
run: ARCHS=${{ matrix.arch }} PLATFORM_NAME=iphoneos make
- name: 'Build WG'
working-directory: awg-apple/Sources/WireGuardKitGo
run: ARCHS=${{ matrix.arch }} PLATFORM_NAME=iphoneos make

- name: Upload Artifact
uses: actions/upload-artifact@v2.2.4
with:
name: awg-ios-${{ matrix.arch }}
path: ${{ github.workspace }}/awg-apple/Sources/WireGuardKitGo/out
if-no-files-found: error
retention-days: 7
- name: 'Archive artifacts'
uses: actions/upload-artifact@v4
with:
name: awg-ios-${{ matrix.arch }}
path: ${{ github.workspace }}/awg-apple/Sources/WireGuardKitGo/out
if-no-files-found: error
retention-days: 7

github-release:
name: GitHub Release
Expand All @@ -44,23 +46,23 @@ jobs:
if: startsWith(github.ref, 'refs/tags/')

steps:
- name: Setup | Checkout
uses: actions/checkout@v2
- name: Setup | Checkout
uses: actions/checkout@v4

- name: Setup | Artifacts
uses: actions/download-artifact@v2
- name: Setup | Artifacts
uses: actions/download-artifact@v4

- name: Setup | Checksums
run: for file in $(find ./ -name '*.a' ); do openssl dgst -sha256 -r "$file" | awk '{print $1}' > "${file}.sha256"; done
- name: Setup | Checksums
run: for file in $(find ./ -name '*.a' ); 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
- name: Zip ALL
run: for file in *; do zip -r ${file%.*}.zip $file; done

- name: Upload binaries to release
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: "*.zip"
tag: ${{ github.ref }}
overwrite: true
file_glob: true
- name: Upload binaries to release
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: "*.zip"
tag: ${{ github.ref }}
overwrite: true
file_glob: true
84 changes: 41 additions & 43 deletions .github/workflows/build_awg_linux.yml
Original file line number Diff line number Diff line change
@@ -1,39 +1,38 @@
name: linux-awg

on: [push]

jobs:

Build-AWG-Linux:
name: 'AmneziaWG for Linux'
runs-on: ubuntu-20.04
if: |
contains(github.event.head_commit.message, '[all]') ||
contains(github.event.head_commit.message, '[linux]') ||
contains(github.event.head_commit.message, '[linux-awg]') ||
contains(github.event.head_commit.message, '[awg]')
name: "WireGuard for Linux"
steps:

- name: 'Get Amnezia WireGuard'
uses: actions/checkout@v3
with:
repository: amnezia-vpn/amneziawg-go
ref: master
path: amnezia-wg

- name: 'Run build script'
working-directory: amnezia-wg
run: |
make
./wireguard-go --version
- name: Archive artifacts
uses: actions/upload-artifact@v3
with:
name: awg-linux
path: amnezia-wg/wireguard-go
- name: 'Get AmneziaWG'
uses: actions/checkout@v4
with:
repository: amnezia-vpn/amneziawg-go
ref: master
path: amneziawg-go

- name: 'Run build script'
working-directory: amneziawg-go
run: |
make
./amneziawg-go --version
- name: 'Archive artifacts'
uses: actions/upload-artifact@v4
with:
name: awg-linux
path: amneziawg-go/amneziawg-go

github-release:
name: GitHub Release
Expand All @@ -42,24 +41,23 @@ jobs:
if: startsWith(github.ref, 'refs/tags/')

steps:
- name: Setup | Checkout
uses: actions/checkout@v2

- name: Setup | Artifacts
uses: actions/download-artifact@v2

- name: Setup | Checksums
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

- name: Upload binaries to release
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: awg-linux.zip
tag: ${{ github.ref }}
overwrite: true
file_glob: true

- name: Setup | Checkout
uses: actions/checkout@v4

- name: Setup | Artifacts
uses: actions/download-artifact@v4

- name: Setup | Checksums
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

- name: Upload binaries to release
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: awg-linux.zip
tag: ${{ github.ref }}
overwrite: true
file_glob: true
86 changes: 42 additions & 44 deletions .github/workflows/build_awg_macos.yml
Original file line number Diff line number Diff line change
@@ -1,65 +1,63 @@
name: macos-awg

on: [push]

jobs:

Build-AWG-MacOS:
name: 'AmneziaWG for MacOS'
runs-on: macos-11
if: |
contains(github.event.head_commit.message, '[all]') ||
contains(github.event.head_commit.message, '[macos]') ||
contains(github.event.head_commit.message, '[macos-awg]') ||
contains(github.event.head_commit.message, '[awg]')
name: "WireGuard for MacOS"
steps:

- name: 'Get WireGuard'
uses: actions/checkout@v3
with:
repository: amnezia-vpn/amneziawg-go
ref: master
path: amnezia-wg

- name: 'Run build script'
working-directory: amnezia-wg
run: |
make
./wireguard-go --version
- name: Archive artifacts
uses: actions/upload-artifact@v3
with:
name: awg-macos
path: amnezia-wg/wireguard-go
- name: 'Get AmneziaWG'
uses: actions/checkout@v4
with:
repository: amnezia-vpn/amneziawg-go
ref: master
path: amneziawg-go

- name: 'Run build script'
working-directory: amneziawg-go
run: |
make
./amneziawg-go --version
- name: 'Archive artifacts'
uses: actions/upload-artifact@v4
with:
name: awg-macos
path: amneziawg-go/amneziawg-go

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

steps:
- name: Setup | Checkout
uses: actions/checkout@v2

- name: Setup | Artifacts
uses: actions/download-artifact@v2

- name: Setup | Checksums
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

- name: Upload binaries to release
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: awg-macos.zip
tag: ${{ github.ref }}
overwrite: true
file_glob: true

- name: Setup | Checkout
uses: actions/checkout@v4

- name: Setup | Artifacts
uses: actions/download-artifact@v4

- name: Setup | Checksums
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

- name: Upload binaries to release
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: awg-macos.zip
tag: ${{ github.ref }}
overwrite: true
file_glob: true
Loading

0 comments on commit 84e9f45

Please sign in to comment.