Skip to content

Commit

Permalink
feat(build): create release on tag push
Browse files Browse the repository at this point in the history
  • Loading branch information
riezebosch committed Feb 14, 2020
1 parent 9914155 commit 120edb1
Show file tree
Hide file tree
Showing 2 changed files with 69 additions and 1 deletion.
68 changes: 68 additions & 0 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
on:
push:
tags:
- v*

name: release
jobs:
deploy:
runs-on: windows-latest
steps:
- uses: actions/checkout@v2

- name: install go
uses: actions/setup-go@v1

- name: get tools
run: |
go get -u github.com/go-bindata/go-bindata/...
go get -u github.com/mitchellh/gox/...
- name: get deps
run: go get -v -t -d ./...

- name: build
run: |
$env:PATH = "$env:PATH;$(go env GOPATH)\bin" # https://github.com/actions/setup-go/issues/14
go-bindata html
gox -output "dist/{{.OS}}/{{.Arch}}/{{.Dir}}"
- name: hash
run: |
(Get-FileHash -Path ./dist/windows/amd64/gitviz.exe -Algorithm SHA256).Hash >> ./choco/tools/LICENSE.txt
- id: version
run: echo "::set-output name=version::$($env:GITHUB_REF.Substring(11))"

- name: choco pack
uses: crazy-max/ghaction-chocolatey@v1
with:
args: pack ./choco/gitviz.nuspec --version ${{ steps.version.outputs.version }}

- name: release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.ref }}
release_name: Release ${{ github.ref }}
body: ""
draft: false
prerelease: false

- name: assets
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./dist/windows/amd64/gitviz.exe
asset_name: gitviz.exe
asset_content_type: application/exe

- name: choco push
uses: crazy-max/ghaction-chocolatey@v1
with:
args: push --api-key=${{ secrets.CHOCOLATEY_APIKEY }}

2 changes: 1 addition & 1 deletion .github/workflows/go.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
on: [push, pull_request]
name: Test
name: test
jobs:
test:
strategy:
Expand Down

0 comments on commit 120edb1

Please sign in to comment.