From 95c0992b23e5c91443cdd35fb3f6024b51cd7e5d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=B8ren=20L=2E=20Hansen?= Date: Thu, 3 Jun 2021 13:29:57 -0700 Subject: [PATCH] Publish artifacts on push to master --- .github/workflows/pre-release.yaml | 36 ++++++++++++++++++++++++++++++ Makefile | 12 +++++----- 2 files changed, 42 insertions(+), 6 deletions(-) create mode 100644 .github/workflows/pre-release.yaml diff --git a/.github/workflows/pre-release.yaml b/.github/workflows/pre-release.yaml new file mode 100644 index 0000000..8e8c6ca --- /dev/null +++ b/.github/workflows/pre-release.yaml @@ -0,0 +1,36 @@ +--- +name: "pre-release" + +on: + push: + branches: + - "gh-workflows" + +jobs: + pre-release: + name: "Pre Release" + runs-on: "ubuntu-latest" + + steps: + - uses: actions/checkout@v2 + with: + fetch-depth: 0 + + - name: Set up Go + uses: actions/setup-go@v2 + with: + go-version: 1.16 + + + - name: "Build & test" + run: "make tools release-artifacts" + + - uses: "marvinpinto/action-automatic-releases@latest" + with: + repo_token: "${{ secrets.GITHUB_TOKEN }}" + automatic_release_tag: "latest" + prerelease: true + title: "Development Build" + files: | + LICENSE + builds/dist/* \ No newline at end of file diff --git a/Makefile b/Makefile index f283fc5..8fbeecf 100644 --- a/Makefile +++ b/Makefile @@ -3,21 +3,21 @@ GIT_COMMIT = `git rev-parse HEAD | cut -c1-7` VERSION = $(shell git describe --tags) BUILD_OPTIONS = -ldflags "-X main.Version=$(VERSION)" -gotty: main.go server/*.go webtty/*.go backend/*.go Makefile asset +gotty: main.go server/*.go webtty/*.go backend/*.go Makefile server/asset.go go build ${BUILD_OPTIONS} docker: docker build . -t gotty-bash:$(VERSION) -.PHONY: asset -asset: bindata/static/js/gotty.js bindata/static/index.html bindata/static/icon.svg bindata/static/favicon.ico bindata/static/css/index.css bindata/static/css/xterm.css bindata/static/css/xterm_customize.css bindata/static/manifest.json bindata/static/icon_192.png server/asset.go +.PHONY: assets +assets: bindata/static/js/gotty.js bindata/static/index.html bindata/static/icon.svg bindata/static/favicon.ico bindata/static/css/index.css bindata/static/css/xterm.css bindata/static/css/xterm_customize.css bindata/static/manifest.json bindata/static/icon_192.png -server/asset.go: bindata/* bindata/*/* bindata/*/*/* +server/asset.go: assets go-bindata -prefix bindata -pkg server -ignore=\\.gitkeep -o server/asset.go bindata/... gofmt -w server/asset.go .PHONY: all -all: asset gotty docker +all: gotty docker bindata: mkdir bindata @@ -91,7 +91,7 @@ targz: shasums: cd ${OUTPUT_DIR}/dist; sha256sum * > ./SHA256SUMS -release-artifacts: asset gotty cross_compile targz shasums +release-artifacts: gotty cross_compile targz shasums release: ghr -draft ${VERSION} ${OUTPUT_DIR}/dist # -c ${GIT_COMMIT} --delete --prerelease -u sorenisanerd -r gotty ${VERSION}