From fbd799f9f92f47b72319a7918587012d6f672159 Mon Sep 17 00:00:00 2001 From: bjdgyc Date: Tue, 30 Jan 2024 18:23:09 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=20Release?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/release.yml | 15 ++++++++++----- .gitignore | 3 ++- release.sh | 26 ++++++++++++++------------ server/dbdata/db.go | 21 +++++---------------- 4 files changed, 31 insertions(+), 34 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index f0c5598..84e06c6 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -64,18 +64,23 @@ jobs: #cache-to: type=gha,mode=max context: . file: ./docker/Dockerfile - platforms: linux/amd64,linux/arm64 + #platforms: linux/amd64,linux/arm64 + platforms: linux/amd64 build-args: | appVer=${{ env.APP_VER }} commitId=${{ env.commitId }} #tags: bjdgyc/anylink:latest,bjdgyc/anylink:${{ env.APP_VER }} tags: bjdgyc/anylink:${{ env.APP_VER }} - - name: Build Copy binary + - name: Build deploy binary shell: bash - run: | - #sudo apt-get install -y -q gcc-aarch64-linux-gnu g++-aarch64-linux-gnu - bash release.sh + run: bash release.sh + + - name: Release + uses: softprops/action-gh-release@v1 + #if: startsWith(github.ref, 'refs/tags/') + with: + files: artifact/* # Docker: # name: build-docker diff --git a/.gitignore b/.gitignore index 1e5c7b0..698379b 100644 --- a/.gitignore +++ b/.gitignore @@ -3,4 +3,5 @@ anylink-deploy anylink-deploy.tar.gz -dist \ No newline at end of file +dist +artifact-dist \ No newline at end of file diff --git a/release.sh b/release.sh index e1dd33d..b8276b3 100644 --- a/release.sh +++ b/release.sh @@ -17,30 +17,32 @@ cpath=$(pwd) ver=$(cat version) echo "当前版本 $ver" -mkdir archive anylink-deploy +mkdir artifact-dist +rm -rf artifact-dist/* app function archive() { os=$1 arch=$2 - echo "整理部署文件 $os $arch" + #echo "整理部署文件 $os $arch" deploy="anylink-$ver-$os-$arch" - docker container create --platform $os/$arch --name $deploy bjdgyc/anylink - rm -rf anylink-deploy/* - docker cp -a $deploy:/app/ ./anylink-deploy/ - ls -lh anylink-deploy - tar zcf ${deploy}.tar.gz anylink-deploy - mv ${deploy}.tar.gz archive/ -} + docker container create --platform $os/$arch --name $deploy bjdgyc/anylink:$ver + docker cp -a $deploy:/app ./ + rm -rf anylink-deploy + mv app anylink-deploy + ls -lh anylink-deploy + + tar zcf ${deploy}.tar.gz anylink-deploy + mv ${deploy}.tar.gz artifact-dist/ +} echo "copy二进制文件" archive linux amd64 -archive linux arm64 - -ls -lh archive +#archive linux arm64 +ls -lh artifact #注意使用root权限运行 #cd anylink-deploy diff --git a/server/dbdata/db.go b/server/dbdata/db.go index bfb023e..448a337 100644 --- a/server/dbdata/db.go +++ b/server/dbdata/db.go @@ -101,22 +101,11 @@ func addInitData() error { // SettingDnsProvider provider := &SettingLetsEncrypt{ - Domain: "vpn.xxx.com", - Legomail: "legomail", - Name: "aliyun", - Renew: false, - DNSProvider: DNSProvider{ - AliYun: struct { - APIKey string `json:"apiKey"` - SecretKey string `json:"secretKey"` - }{APIKey: "", SecretKey: ""}, - TXCloud: struct { - SecretID string `json:"secretId"` - SecretKey string `json:"secretKey"` - }{SecretID: "", SecretKey: ""}, - CfCloud: struct { - AuthToken string `json:"authToken"` - }{AuthToken: ""}}, + Domain: "vpn.xxx.com", + Legomail: "legomail", + Name: "aliyun", + Renew: false, + DNSProvider: DNSProvider{}, } err = SettingSessAdd(sess, provider) if err != nil {