Skip to content

Commit beab35a

Browse files
committed
update public releases on tag
1 parent a65ea3b commit beab35a

File tree

2 files changed

+26
-2
lines changed

2 files changed

+26
-2
lines changed

.github/workflows/go-build.yml

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,3 +37,29 @@ jobs:
3737
- name: Make Build
3838
run: |
3939
make build
40+
41+
- name: Get the version
42+
id: get_version
43+
run: echo ::set-output name=VERSION::$(echo $(git describe --tags --always))
44+
45+
- name: Create Release
46+
id: create_release
47+
uses: actions/create-release@v1
48+
env:
49+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # This token is provided by Actions, you do not need to create your own token
50+
with:
51+
tag_name: ${{ steps.get_version.outputs.VERSION }}
52+
release_name: Release ${{ steps.get_version.outputs.VERSION }}
53+
draft: false
54+
prerelease: true
55+
56+
- name: Upload Release Asset
57+
id: upload-release-asset
58+
uses: actions/upload-release-asset@v1
59+
env:
60+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
61+
with:
62+
upload_url: ${{ steps.create_release.outputs.upload_url }} # This pulls from the CREATE RELEASE step above, referencing it's ID to get its outputs object, which include a `upload_url`. See this blog post for more info: https://jasonet.co/posts/new-features-of-github-actions/#passing-data-to-future-steps
63+
asset_path: ./dist/browser-gopher-${{ steps.get_version.outputs.VERSION }}/browser-gopher
64+
asset_name: browser-gopher-${{ steps.get_version.outputs.VERSION }}-${{ matrix.os }}
65+
asset_content_type: application/octet-stream

Makefile

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,4 @@ build: dist
1616
@CGO_ENABLED=0 go build -ldflags "-X github.com/iansinnott/browser-gopher/cmd.Version=$(VERSION)"
1717
@echo "Building $(NAME) $(VERSION) for $(shell go env GOOS)/$(shell go env GOARCH)..."
1818
@CGO_ENABLED=0 go build -ldflags "-X github.com/iansinnott/browser-gopher/cmd.Version=$(VERSION)" -o $(OUTDIR)/$(NAME)
19-
@echo "Building $(NAME) $(VERSION) for linux/amd64..."
20-
@CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -ldflags "-X github.com/iansinnott/browser-gopher/cmd.Version=$(VERSION)" -o $(OUTDIR)/$(NAME)-linux-amd64
2119
@echo "Done."

0 commit comments

Comments
 (0)