Publish artifacts on push to master

This commit is contained in:
Søren L. Hansen 2021-06-03 13:29:57 -07:00
parent 679a3247c6
commit 6c62ab74b7
2 changed files with 43 additions and 6 deletions

37
.github/workflows/pre-release.yaml vendored Normal file
View File

@ -0,0 +1,37 @@
---
name: "pre-release"
on:
push:
branches:
- "master"
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/*

View File

@ -3,21 +3,21 @@ GIT_COMMIT = `git rev-parse HEAD | cut -c1-7`
VERSION = $(shell git describe --tags) VERSION = $(shell git describe --tags)
BUILD_OPTIONS = -ldflags "-X main.Version=$(VERSION)" 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} go build ${BUILD_OPTIONS}
docker: docker:
docker build . -t gotty-bash:$(VERSION) docker build . -t gotty-bash:$(VERSION)
.PHONY: asset .PHONY: assets
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 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/... go-bindata -prefix bindata -pkg server -ignore=\\.gitkeep -o server/asset.go bindata/...
gofmt -w server/asset.go gofmt -w server/asset.go
.PHONY: all .PHONY: all
all: asset gotty docker all: gotty docker
bindata: bindata:
mkdir bindata mkdir bindata
@ -91,7 +91,7 @@ targz:
shasums: shasums:
cd ${OUTPUT_DIR}/dist; sha256sum * > ./SHA256SUMS cd ${OUTPUT_DIR}/dist; sha256sum * > ./SHA256SUMS
release-artifacts: asset gotty cross_compile targz shasums release-artifacts: gotty cross_compile targz shasums
release: release:
ghr -draft ${VERSION} ${OUTPUT_DIR}/dist # -c ${GIT_COMMIT} --delete --prerelease -u sorenisanerd -r gotty ${VERSION} ghr -draft ${VERSION} ${OUTPUT_DIR}/dist # -c ${GIT_COMMIT} --delete --prerelease -u sorenisanerd -r gotty ${VERSION}