Skip to content

Commit

Permalink
test release windows
Browse files Browse the repository at this point in the history
  • Loading branch information
PinkD committed Dec 1, 2024
1 parent e53664d commit a57d637
Show file tree
Hide file tree
Showing 4 changed files with 50 additions and 7 deletions.
32 changes: 32 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: test

on:
push:
branches:
- test

jobs:
build-windows:
name: build-windows
runs-on: windows-latest
steps:
- name: checkout code
uses: actions/checkout@v4
- name: setup go
uses: actions/setup-go@v5
with:
go-version: '>=1.22.0'
- name: build libwg
run: cd libwg && ./build.ps1
- name: rust install gnu toolchain
run: rustup toolchain install stable-gnu
- name: rust use gnu toolchain
run: rustup default stable-x86_64-pc-windows-gnu
- name: build package
run: cargo build --release
- name: build check result
run: |
cd target
cp release/corplink-rs .
Compress-Archive -Path corplink-rs,config.json -Destination corplink-rs-${{ github.ref_name }}-windows.zip
ls
11 changes: 11 additions & 0 deletions libwg/build.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# 初始化并更新所有子模块
git submodule update --init --recursive

# 切换到 wireguard-go 目录
Set-Location wireguard-go

# 编译 libwg
make libwg

# 将生成的 libwg 文件移动到上级目录
Move-Item -Path "libwg.*" -Destination ".."
3 changes: 3 additions & 0 deletions libwg/version.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
package main

const Version = "windows-version"
11 changes: 4 additions & 7 deletions pack/PKGBUILD
Original file line number Diff line number Diff line change
Expand Up @@ -7,24 +7,21 @@ pkgrel=1
pkgdesc='Corplink client written in Rust'
arch=('i686' 'x86_64')
url='https://github.com/PinkD/corplink-rs'
license=('GPL2')
license=('GPL-2.0-only')
makedepends=('cargo' 'go' 'clang')
source=(
"$pkgname.$pkgver.tar.gz"::"https://github.com/PinkD/corplink-rs/archive/$pkgver.tar.gz"
"wireguard-go"::"git+https://github.com/PinkD/wireguard-go"
)
# use SKIP to avoid update PKGBUILD everytime
sha256sums=(
'SKIP'
'SKIP'
)
backup=(etc/corplink/config.json)

build() {
# build libwg
cd "$srcdir/wireguard-go"
make libwg
cp libwg.* "$srcdir/$_pkgbase-$pkgver/libwg/"
cd "$srcdir/$_pkgbase-$pkgver/libwg"
./build.sh
cp libwg.* ../q

# build corplink-rs
cd "$srcdir/$_pkgbase-$pkgver"
Expand Down

0 comments on commit a57d637

Please sign in to comment.