From f0cb292dc68690a0c12f816810c7393d32f82b4c Mon Sep 17 00:00:00 2001 From: Asen <78863300+AsenHu@users.noreply.github.com> Date: Thu, 6 Jun 2024 02:31:48 +0800 Subject: [PATCH] CI: not create zip file when not releasing Makefile: remove unneccesary `install` target & Add build to `.PHONY` target --- .github/workflows/release.yml | 7 ++++--- Makefile | 5 +---- 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 26d14c14..9a9a30c5 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -17,14 +17,14 @@ on: - "**/*.go" - "go.mod" - "go.sum" - - ".github/workflows/*.yml" + - ".github/workflows/release.yml" pull_request: types: [opened, synchronize, reopened] paths: - "**/*.go" - "go.mod" - "go.sum" - - ".github/workflows/*.yml" + - ".github/workflows/release.yml" jobs: prepare: runs-on: ubuntu-latest @@ -183,7 +183,7 @@ jobs: run: | mkdir -p build_assets make - find . -maxdepth 1 -type f -regex '.*\(wxray\|xray\|xray_softfloat\)\(\|.exe\)' -exec mv {} ./build_assets/ \; + find . -maxdepth 1 -type f -regex './\(wxray\|xray\|xray_softfloat\)\(\|.exe\)' -exec mv {} ./build_assets/ \; - name: Restore Cache uses: actions/cache/restore@v4 @@ -198,6 +198,7 @@ jobs: cp ${GITHUB_WORKSPACE}/LICENSE ./build_assets/LICENSE - name: Create ZIP archive + if: github.event_name == 'release' shell: bash run: | pushd build_assets || exit 1 diff --git a/Makefile b/Makefile index 29f580c5..e6c13953 100644 --- a/Makefile +++ b/Makefile @@ -26,15 +26,12 @@ endif ifeq ($(shell echo "$(GOARCH)" | grep -Eq "(mips|mipsle)" && echo true),true) # ADDITION = GOMIPS=softfloat go build -o $(NAME)_softfloat -trimpath -ldflags "$(LDFLAGS)" -v $(MAIN) endif -.PHONY: clean +.PHONY: clean build build: go build -o $(OUTPUT) $(PARAMS) $(MAIN) $(ADDITION) -install: - go build -o $(PREFIX)/bin/$(OUTPUT) $(PARAMS) $(MAIN) - clean: go clean -v -i $(PWD) rm -f xray xray.exe wxray.exe xray_softfloat