Update go.yml #38
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: release | |
on: | |
push: | |
branches: | |
- master | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- uses: actions/setup-go@v2 | |
with: | |
go-version: "^1.13.1" | |
- name: Build normal | |
run: | | |
CGO_ENABLED=0 GOOS=windows GOARCH=amd64 go build -ldflags="-w -s" -o normal-windows-x64.exe cmd/normal/main.go | |
CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -ldflags="-w -s" -o normal-linux-x64 cmd/normal/main.go | |
CGO_ENABLED=0 GOOS=darwin GOARCH=amd64 go build -ldflags="-w -s" -o normal-darwin-x64 cmd/normal/main.go | |
zip normal-windows-x64.zip normal-windows-x64.exe | |
zip normal-linux-x64.zip normal-linux-x64 | |
zip normal-darwin-x64.zip normal-darwin-x64 | |
# - name: Build cgo | |
# run: | | |
# go get github.com/monkeyWie/xgo | |
# ~/go/bin/xgo -targets=windows/amd64,linux/amd64,darwin/amd64 -ldflags="-w -s" -pkg=cmd/cgo/main.go -out=cgo . | |
# mv cgo-windows-* cgo-windows-x64.exe | |
# mv cgo-linux-* cgo-linux-x64 | |
# mv cgo-darwin-* cgo-darwin-x64 | |
# zip cgo-windows-x64.zip cgo-windows-x64.exe | |
# zip cgo-linux-x64.zip cgo-linux-x64 | |
# zip cgo-darwin-x64.zip cgo-darwin-x64 | |
- uses: release-drafter/release-drafter@v5 | |
id: create_release | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
- name: Upload Release normal windows | |
uses: actions/[email protected] | |
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: ./normal-windows-x64.zip | |
asset_name: normal-${{ steps.create_release.outputs.name }}-windows-x64.zip | |
asset_content_type: application/zip | |
- name: Upload Release normal linux | |
uses: actions/[email protected] | |
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: ./normal-linux-x64.zip | |
asset_name: normal-${{ steps.create_release.outputs.name }}-linux-x64.zip | |
asset_content_type: application/zip | |
- name: Upload Release normal darwin | |
uses: actions/[email protected] | |
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: ./normal-darwin-x64.zip | |
asset_name: normal-${{ steps.create_release.outputs.name }}-darwin-x64.zip | |
asset_content_type: application/zip | |
# - name: Upload Release cgo windows | |
# uses: actions/[email protected] | |
# 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: ./cgo-windows-x64.zip | |
# asset_name: cgo-${{ steps.create_release.outputs.name }}-windows-x64.zip | |
# asset_content_type: application/zip | |
# - name: Upload Release cgo linux | |
# uses: actions/[email protected] | |
# 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: ./cgo-linux-x64.zip | |
# asset_name: cgo-${{ steps.create_release.outputs.name }}-linux-x64.zip | |
# asset_content_type: application/zip | |
# - name: Upload Release cgo darwin | |
# uses: actions/[email protected] | |
# 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: ./cgo-darwin-x64.zip | |
# asset_name: cgo-${{ steps.create_release.outputs.name }}-darwin-x64.zip | |
# asset_content_type: application/zip |