From ec8dc17df2ddce39b32c7784a9da31ec22a67f00 Mon Sep 17 00:00:00 2001 From: Ferenc Date: Fri, 20 Aug 2021 00:52:37 +0200 Subject: [PATCH] docs(examples/github-actions.yml): add github actions example --- examples/github-actions.yml | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 examples/github-actions.yml diff --git a/examples/github-actions.yml b/examples/github-actions.yml new file mode 100644 index 0000000..1724444 --- /dev/null +++ b/examples/github-actions.yml @@ -0,0 +1,29 @@ +name: Go +on: [ push, pull_request ] +jobs: + build: + name: Build + runs-on: ubuntu-latest + steps: + - name: Check out code into the Go module directory + uses: actions/checkout@v1 + + - name: Init go-semantic-release + run: | + wget https://github.com/Nightapes/go-semantic-release/releases/download/v2.0.1/go-semantic-release.linux_x86_64.zip + unzip go-semantic-release.linux_x86_64.zip + chmod +x go-semantic-release.linux_x86_64 + + - name: Build binary + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + run: | + GOOS=linux GOARCH=amd64 CGO_ENABLED=0 go build -o .linux_x86_64 + GOOS=windows GOARCH=386 CGO_ENABLED=0 go build -o .windows_i386.exe + GOOS=windows GOARCH=amd64 CGO_ENABLED=0 go build -o .windows_x86_64.exe + GOOS=darwin GOARCH=amd64 CGO_ENABLED=0 go build -o .darwin_x86_64 + + - name: Release + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + run: ./go-semantic-release.linux_x86_64 release --loglevel trace \ No newline at end of file