diff --git a/.claude/settings.json b/.claude/settings.json new file mode 100644 index 0000000..25655fa --- /dev/null +++ b/.claude/settings.json @@ -0,0 +1,7 @@ +{ + "permissions": { + "allow": [ + "Bash(git diff:*)" + ] + } +} diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index a4276cd..4901263 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -94,6 +94,23 @@ jobs: total_coverage=$(go tool cover -func=coverage.txt | grep total | awk '{print $3}') echo "**Total Coverage:** $total_coverage" >> $GITHUB_STEP_SUMMARY + - name: make build-dist + run: | + echo "## make build-dist" >> $GITHUB_STEP_SUMMARY + GIT_VERSION=${{ github.ref_name }} make build-dist | tee -a $GITHUB_STEP_SUMMARY + + - name: make build-dist-zip + run: | + echo "## make build-dist-zip" >> $GITHUB_STEP_SUMMARY + GIT_VERSION=${{ github.ref_name }} make build-dist-zip | tee -a $GITHUB_STEP_SUMMARY + + - name: Upload Distribution files to release + uses: softprops/action-gh-release@v2 + with: + tag_name: ${{ github.ref_name }} + files: | + dist/assets/*.zip + - name: Release uses: softprops/action-gh-release@v2 with: diff --git a/.gitignore b/.gitignore index aaadf73..24f974e 100644 --- a/.gitignore +++ b/.gitignore @@ -30,3 +30,6 @@ go.work.sum # Editor/IDE # .idea/ # .vscode/ + +.DS_Store +dist/ \ No newline at end of file diff --git a/.vscode/settings.json b/.vscode/settings.json index 5967638..2b4c6de 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -1,6 +1,7 @@ { "cSpell.words": [ "betteralign", + "Errorf", "golangci", "govulncheck", "ioreg", diff --git a/Makefile b/Makefile index a420674..5c6d637 100644 --- a/Makefile +++ b/Makefile @@ -204,7 +204,9 @@ build-dist-zip: ## Build the application for all platforms defined in GO_OS and $(foreach GOOS, $(GO_OS), \ $(foreach GOARCH, $(GO_ARCH), \ $(foreach proj_mod, $(PROJECT_MODULES_NAME), \ - $(call exec_cmd, zip --junk-paths -r $(DIST_ASSETS_DIR)/$(proj_mod)-$(GOOS)-$(GOARCH).zip $(DIST_DIR)/$(proj_mod)-$(GOOS)-$(GOARCH) ) \ + $(call exec_cmd, cp $(DIST_DIR)/$(proj_mod)-$(GOOS)-$(GOARCH) $(DIST_DIR)/$(proj_mod) ) \ + $(call exec_cmd, zip --junk-paths -r $(DIST_ASSETS_DIR)/$(proj_mod)-$(GOOS)-$(GOARCH).zip $(DIST_DIR)/$(proj_mod) ) \ + $(call exec_cmd, rm $(DIST_DIR)/$(proj_mod) ) \ $(call exec_cmd, shasum -a 256 $(DIST_ASSETS_DIR)/$(proj_mod)-$(GOOS)-$(GOARCH).zip | cut -d ' ' -f 1 > $(DIST_ASSETS_DIR)/$(proj_mod)-$(GOOS)-$(GOARCH).sha256 ) \ ) \ ) \ diff --git a/README.md b/README.md index 0be9bec..06e6459 100644 --- a/README.md +++ b/README.md @@ -82,11 +82,9 @@ export GIT_REPO="machineid" export OS=$(uname -s | tr '[:upper:]' '[:lower:]') export OS_ARCH=$(uname -m | tr '[:upper:]' '[:lower:]') export ASSETS_NAME=$(gh release view --repo ${GIT_ORG}/${GIT_REPO} --json assets -q "[.assets[] | select(.name | contains(\"${TOOL_NAME}\") and contains(\"${OS}\") and contains(\"${OS_ARCH}\"))] | sort_by(.createdAt) | last.name") -export APP_NAME="${ASSETS_NAME%.*}" gh release download --repo $GIT_ORG/$GIT_REPO --pattern $ASSETS_NAME unzip $ASSETS_NAME -mv $APP_NAME $TOOL_NAME rm $ASSETS_NAME mv $TOOL_NAME ~/go/bin/$TOOL_NAME