Skip to content

Commit 3f7c9b6

Browse files
committed
init
1 parent f53535d commit 3f7c9b6

File tree

14 files changed

+643
-0
lines changed

14 files changed

+643
-0
lines changed

.github/build/linux.yml

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
env:
2+
- GO111MODULE=on
3+
4+
project_name: wget
5+
builds:
6+
- id: wget-linux
7+
ldflags:
8+
- -s -w
9+
binary: wget
10+
env:
11+
- CGO_ENABLED=1
12+
# 0 你再重新编译链接,那么 Go 链接器会使用 Go 版本的实现,这样你将得到一个没有动态链接的纯静态二进制程序
13+
main: main.go
14+
goos:
15+
- linux
16+
goarch:
17+
- amd64
18+
# hooks:
19+
# post:
20+
# - upx --brute dist/51pwnPlatform-linux_linux_amd64_*/51pwnPlatform
21+
# - ./.github/upx.sh
22+
archives:
23+
- format: zip
24+
25+
checksum:
26+
name_template: "{{ .ProjectName }}-linux-checksums.txt"

.github/build/mac.yml

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
env:
2+
- GO111MODULE=on
3+
4+
project_name: wget
5+
builds:
6+
- id: wget-darwin
7+
ldflags:
8+
- -s -w
9+
binary: wget
10+
env:
11+
- CGO_ENABLED=1
12+
main: main.go
13+
goos:
14+
- darwin
15+
goarch:
16+
- amd64
17+
# hooks:
18+
# post:
19+
# - upx --brute dist/51pwnPlatform-darwin_darwin_amd64_*/51pwnPlatform
20+
# - ./.github/upx.sh
21+
22+
archives:
23+
- format: zip
24+
replacements:
25+
darwin: macOS
26+
27+
checksum:
28+
name_template: "{{ .ProjectName }}-mac-checksums.txt"

.github/build/mac_arm64.yml

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
env:
2+
- GO111MODULE=on
3+
4+
project_name: wget
5+
builds:
6+
- id: wget-darwin
7+
ldflags:
8+
- -s -w
9+
binary: wget
10+
env:
11+
- CGO_ENABLED=1
12+
main: main.go
13+
goos:
14+
- darwin
15+
goarch:
16+
- arm64
17+
# hooks:
18+
# post:
19+
# - ./.github/upx.sh
20+
21+
archives:
22+
- format: zip
23+
replacements:
24+
darwin: macOS
25+
26+
checksum:
27+
name_template: "{{ .ProjectName }}-mac-arm64-checksums.txt"

.github/build/windows.yml

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
env:
2+
- GO111MODULE=on
3+
#before:
4+
# hooks:
5+
# - ./.github/upx.sh
6+
project_name: wget
7+
builds:
8+
- id: wget-windows
9+
ldflags:
10+
- -s -w
11+
binary: wget
12+
env:
13+
- CGO_ENABLED=1
14+
- CC=x86_64-w64-mingw32-gcc
15+
- CXX=x86_64-w64-mingw32-g++
16+
main: main.go
17+
goos:
18+
- windows
19+
goarch:
20+
- amd64
21+
22+
archives:
23+
- format: zip
24+
25+
checksum:
26+
name_template: "{{ .ProjectName }}-windows-checksums.txt"

.github/workflows/build.yml

Lines changed: 88 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,88 @@
1+
name: 🎉 Release Binary
2+
on:
3+
create:
4+
tags:
5+
- v*
6+
workflow_dispatch:
7+
8+
jobs:
9+
build-mac:
10+
runs-on: macos-latest
11+
steps:
12+
- name: Code checkout
13+
uses: actions/checkout@v2
14+
with:
15+
submodules: recursive
16+
fetch-depth: 0
17+
- name: Checkout submodules
18+
run: git submodule update --init --recursive
19+
- name: Set up Go
20+
uses: actions/setup-go@v2
21+
with:
22+
go-version: 1.19
23+
- name: Install Dependences
24+
run: |
25+
brew install libpcap upx
26+
# git submodule update --init --recursive --remote
27+
- name: Run GoReleaser
28+
uses: goreleaser/goreleaser-action@v2
29+
with:
30+
version: latest
31+
args: release -f .github/build/mac.yml --clean
32+
env:
33+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
34+
# https://github.com/marketplace/actions/run-on-architecture#supported-platforms
35+
build-linux:
36+
runs-on: ubuntu-latest
37+
steps:
38+
- name: Code checkout
39+
uses: actions/checkout@v2
40+
with:
41+
submodules: recursive
42+
fetch-depth: 0
43+
- name: Checkout submodules
44+
run: git submodule update --init --recursive
45+
- name: Set up Go
46+
uses: actions/setup-go@v2
47+
with:
48+
go-version: 1.19
49+
- name: Install Dependences
50+
run: |
51+
sudo apt install -yy --fix-missing libpcap-dev upx
52+
# git submodule update --init --recursive --remote
53+
- name: Run GoReleaser
54+
uses: goreleaser/goreleaser-action@v2
55+
with:
56+
version: latest
57+
args: release -f .github/build/linux.yml --clean
58+
env:
59+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
60+
61+
build-windows:
62+
runs-on: windows-latest
63+
steps:
64+
- name: Code checkout
65+
uses: actions/checkout@v2
66+
with:
67+
submodules: recursive
68+
fetch-depth: 0
69+
- name: Checkout submodules
70+
run: git submodule update --init --recursive
71+
# - name: Install upx
72+
# run: |
73+
# mkdir upx
74+
# [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12
75+
# Invoke-WebRequest "https://github.com/upx/upx/releases/download/v3.96/upx-3.96-win32.zip" -OutFile "upx.zip"
76+
# Expand-Archive upx.zip -DestinationPath upx
77+
# setx PATH "$env:PATH;$(Get-Location)/upx/x86_64-w64-mingw32"
78+
- name: Set up Go
79+
uses: actions/setup-go@v2
80+
with:
81+
go-version: 1.19
82+
- name: Run GoReleaser
83+
uses: goreleaser/goreleaser-action@v2
84+
with:
85+
version: latest
86+
args: release -f .github/build/windows.yml --clean
87+
env:
88+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.github/workflows/codeql-analysis.yml

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
name: 🚨 CodeQL Analysis
2+
3+
on:
4+
workflow_dispatch:
5+
push:
6+
pull_request:
7+
branches:
8+
- dev
9+
10+
jobs:
11+
analyze:
12+
name: Analyze
13+
runs-on: ubuntu-latest
14+
permissions:
15+
actions: read
16+
contents: read
17+
security-events: write
18+
19+
strategy:
20+
fail-fast: false
21+
matrix:
22+
language: [ 'go' ]
23+
# CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python' ]
24+
25+
steps:
26+
- name: Checkout repository
27+
uses: actions/checkout@v3
28+
29+
# Initializes the CodeQL tools for scanning.
30+
- name: Initialize CodeQL
31+
uses: github/codeql-action/init@v2
32+
with:
33+
languages: ${{ matrix.language }}
34+
35+
- name: Autobuild
36+
uses: github/codeql-action/autobuild@v2
37+
38+
- name: Perform CodeQL Analysis
39+
uses: github/codeql-action/analyze@v2

.idea/.gitignore

Lines changed: 8 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/modules.xml

Lines changed: 8 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/vcs.xml

Lines changed: 6 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/wget-go.iml

Lines changed: 9 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)