Skip to content

Commit

Permalink
update public releases on tag
Browse files Browse the repository at this point in the history
  • Loading branch information
iansinnott committed Aug 20, 2023
1 parent a65ea3b commit beab35a
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 2 deletions.
26 changes: 26 additions & 0 deletions .github/workflows/go-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,3 +37,29 @@ jobs:
- name: Make Build
run: |
make build
- name: Get the version
id: get_version
run: echo ::set-output name=VERSION::$(echo $(git describe --tags --always))

- name: Create Release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # This token is provided by Actions, you do not need to create your own token
with:
tag_name: ${{ steps.get_version.outputs.VERSION }}
release_name: Release ${{ steps.get_version.outputs.VERSION }}
draft: false
prerelease: true

- name: Upload Release Asset
id: upload-release-asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
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
asset_path: ./dist/browser-gopher-${{ steps.get_version.outputs.VERSION }}/browser-gopher
asset_name: browser-gopher-${{ steps.get_version.outputs.VERSION }}-${{ matrix.os }}
asset_content_type: application/octet-stream
2 changes: 0 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,4 @@ build: dist
@CGO_ENABLED=0 go build -ldflags "-X github.com/iansinnott/browser-gopher/cmd.Version=$(VERSION)"
@echo "Building $(NAME) $(VERSION) for $(shell go env GOOS)/$(shell go env GOARCH)..."
@CGO_ENABLED=0 go build -ldflags "-X github.com/iansinnott/browser-gopher/cmd.Version=$(VERSION)" -o $(OUTDIR)/$(NAME)
@echo "Building $(NAME) $(VERSION) for linux/amd64..."
@CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -ldflags "-X github.com/iansinnott/browser-gopher/cmd.Version=$(VERSION)" -o $(OUTDIR)/$(NAME)-linux-amd64
@echo "Done."

0 comments on commit beab35a

Please sign in to comment.