Skip to content

Commit

Permalink
添加 Release
Browse files Browse the repository at this point in the history
  • Loading branch information
bjdgyc committed Jan 30, 2024
1 parent f9ff92d commit fbd799f
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 32 deletions.
15 changes: 10 additions & 5 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,5 @@
anylink-deploy
anylink-deploy.tar.gz

dist
dist
artifact-dist
22 changes: 12 additions & 10 deletions release.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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/
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 archive/
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
Expand Down
21 changes: 5 additions & 16 deletions server/dbdata/db.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit fbd799f

Please sign in to comment.