-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Switch to GH Actions and make releases
- Loading branch information
Showing
4 changed files
with
78 additions
and
21 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
name: Releases | ||
|
||
on: | ||
push: | ||
tags: | ||
- '*' | ||
|
||
jobs: | ||
release: | ||
runs-on: macos-latest | ||
permissions: | ||
contents: write | ||
steps: | ||
- name: checkout | ||
uses: actions/checkout@v3 | ||
|
||
- name: "setup go" | ||
uses: actions/setup-go@v3 | ||
with: | ||
cache: true | ||
go-version-file: 'go.mod' | ||
|
||
- name: build | ||
run: make zip | ||
|
||
- name: "create release" | ||
uses: ncipollo/release-action@v1 | ||
with: | ||
artifactErrorsFailBuild: true | ||
artifacts: "release/*.zip" | ||
draft: true | ||
generateReleaseNotes: true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,2 @@ | ||
sshsrv | ||
/release/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
NAME = sshsrv | ||
PACKAGE = github.com/Crosse/$(NAME) | ||
|
||
default: release | ||
|
||
define build | ||
@env GOOS=$(1) GOARCH=$(2) make release/$(NAME)-$(1)-$(2)$(3) | ||
endef | ||
|
||
release/$(NAME)-%: | ||
GOOS=$(GOOS) GOARCH=$(GOARCH) go build -o "$@" $(PACKAGE) | ||
|
||
release/$(NAME)-darwin-universal: release/$(NAME)-darwin-amd64 release/$(NAME)-darwin-arm64 | ||
$(RM) "$@" | ||
lipo -create -o "$@" $^ | ||
|
||
.PHONY: release | ||
release: | ||
mkdir -p release | ||
$(call build,linux,arm) | ||
$(call build,linux,amd64) | ||
$(call build,linux,arm64) | ||
|
||
$(call build,darwin,amd64) | ||
$(call build,darwin,arm64) | ||
@make release/$(NAME)-darwin-universal | ||
|
||
$(call build,openbsd,arm) | ||
$(call build,openbsd,amd64) | ||
$(call build,openbsd,arm64) | ||
|
||
$(call build,freebsd,arm) | ||
$(call build,freebsd,amd64) | ||
$(call build,freebsd,arm64) | ||
|
||
$(call build,windows,amd64,.exe) | ||
$(call build,windows,arm64,.exe) | ||
|
||
.PHONY: zip | ||
zip: release | ||
find release -type f ! -name '*.zip' -execdir zip -9 "{}.zip" "{}" \; | ||
|
||
.PHONY: clean | ||
clean: | ||
$(RM) -r release |