forked from cdle/sillyGirl
-
Notifications
You must be signed in to change notification settings - Fork 0
92 lines (79 loc) · 2.77 KB
/
go.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
name: Go
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up Go
uses: actions/setup-go@v2
with:
go-version: 1.18
- name: Git clone cable
run:
cd develop && git clone https://${{ secrets.CABLE_TOKEN }}@github.com/cdle/cable.git
- name: Git clone jd_price
run:
cd develop && git clone https://github.com/cdle/jd_price.git
- name: Git clone jd_cookie
run:
cd develop && git clone https://github.com/wcclose/jd_cookie.git
- name: Create dev.go
run:
mv dev.go.demo dev.go
- name: Push to binary
run: |
n=$(date +%s%3N)
echo "package core" > core/compile_time.go
echo "var compiled_at = \"$n\"" >> core/compile_time.go
GOOS=linux GOARCH=arm64 go build -ldflags "-s -w" -o sillyGirl_linux_arm64
GOOS=linux GOARCH=amd64 go build -ldflags "-s -w" -o sillyGirl_linux_amd64
GOOS=windows GOARCH=amd64 go build -ldflags "-s -w" -o sillyGirl_windows_amd64.exe
git clone https://${{ secrets.CABLE_TOKEN }}@github.com/cdle/binary.git
git config --global user.email "[email protected]"
git config --global user.name "Your Name"
cd binary
git checkout --orphan latest_branch
git add -A
git commit -am "commit message"
git branch -D main
git branch -m main
git push -f origin main
cd ..
rm -rf binary/*
cp sillyGirl_linux_amd64 binary/sillyGirl_linux_amd64_$n
cp sillyGirl_linux_arm64 binary/sillyGirl_linux_arm64_$n
cp sillyGirl_windows_amd64.exe binary/sillyGirl_linux_windows_$n.exe
cp core/compile_time.go binary/compile_time.go
cd binary
git add . && git commit -m "update"
git push --set-upstream origin main
wget -q -O - "${{ secrets.VERSION }}$n"
- name: Upload to release
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: sillyGirl_linux_amd64
asset_name: sillyGirl_linux_amd64
tag: ${{ github.ref }}
overwrite: true
- name: Upload to release
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: sillyGirl_windows_amd64.exe
asset_name: sillyGirl_windows_amd64.exe
tag: ${{ github.ref }}
overwrite: true
- name: Upload to release
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: sillyGirl_linux_arm64
asset_name: sillyGirl_linux_arm64
tag: ${{ github.ref }}
overwrite: true