Skip to content

Commit

Permalink
进一步减少硬件资源占用
Browse files Browse the repository at this point in the history
  • Loading branch information
xiwangly2 committed Aug 26, 2023
1 parent e0bd9ad commit ac6ab80
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 2 deletions.
7 changes: 7 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,19 @@ jobs:
restore-keys: |
${{ runner.os }}-go-
- name: Install UPX
run: |
curl -L -o upx.tar.xz https://github.com/upx/upx/releases/latest/download/upx-4.1.0-amd64_linux.tar.xz
tar -xJf upx.tar.xz
mv upx-*-amd64_linux/upx /usr/local/bin/
- name: Build and Release
env:
NAME: connect_jxyy_network # Adjust the project name
BINDIR: bin
run: |
make releases
cp config_example.yaml bin/config.yaml
- name: Upload Release
uses: softprops/action-gh-release@v1
Expand Down
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,5 @@ build/
config.yaml
*.exe
dist/
bin/
bin/
connect_jxyy_network
4 changes: 3 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -124,19 +124,21 @@ gz_releases=$(addsuffix .gz, $(PLATFORM_LIST))
zip_releases=$(addsuffix .zip, $(WINDOWS_ARCH_LIST))

$(gz_releases): %.gz : %
-upx -9 $(BINDIR)/$(basename $@)/$(NAME)
chmod +x $(BINDIR)/$(basename $@)/$(NAME)
gzip -f -S -$(VERSION).gz $(BINDIR)/$(basename $@)/$(NAME)
mv $(BINDIR)/$(basename $@)/$(NAME)-$(VERSION).gz $(BINDIR)/$(NAME)-$(basename $@)-$(VERSION).gz
rm -r $(BINDIR)/$(basename $@)

$(zip_releases): %.zip : %
-upx -9 $(BINDIR)/$(basename $@)/$(NAME)
zip -m -j $(BINDIR)/$(basename $@)/$(NAME)-$(VERSION).zip $(BINDIR)/$(basename $@)/$(NAME).exe
mv $(BINDIR)/$(basename $@)/$(NAME)-$(VERSION).zip $(BINDIR)/$(NAME)-$(basename $@)-$(VERSION).zip
rm -r $(BINDIR)/$(basename $@)

all-arch: $(PLATFORM_LIST) $(WINDOWS_ARCH_LIST)

releases: $(gz_releases) $(zip_releases) ; cp config_example.yaml $(BINDIR)/config.yaml
releases: $(gz_releases) $(zip_releases)

LINT_OS_LIST := darwin windows linux freebsd openbsd

Expand Down

0 comments on commit ac6ab80

Please sign in to comment.