From c43dd3561cf6fd66d9aba92b545e67621f3bcd24 Mon Sep 17 00:00:00 2001 From: 1efty <18194777+1efty@users.noreply.github.com> Date: Sat, 26 Sep 2020 13:05:17 -0500 Subject: [PATCH] Add build and release GitHub actions --- .github/workflows/go.yaml | 38 ++++++++++++++++++++++++++++++++++ .github/workflows/release.yaml | 30 +++++++++++++++++++++++++++ 2 files changed, 68 insertions(+) create mode 100644 .github/workflows/go.yaml create mode 100644 .github/workflows/release.yaml diff --git a/.github/workflows/go.yaml b/.github/workflows/go.yaml new file mode 100644 index 0000000..ca20d81 --- /dev/null +++ b/.github/workflows/go.yaml @@ -0,0 +1,38 @@ +--- +name: Go + +on: + push: + branches: [ master ] + pull_request: + branches: [ master ] + +jobs: + + build: + name: Build + runs-on: ubuntu-latest + steps: + + - name: Set up Go 1.x + uses: actions/setup-go@v2 + with: + go-version: ^1.15 + id: go + + - name: Check out code into the Go module directory + uses: actions/checkout@v2 + + - name: Get dependencies + run: | + go get -v -t -d ./... + if [ -f Gopkg.toml ]; then + curl https://raw.githubusercontent.com/golang/dep/master/install.sh | sh + dep ensure + fi + + - name: Build + run: go build -v . + + - name: Test + run: go test -v . diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml new file mode 100644 index 0000000..290dc6e --- /dev/null +++ b/.github/workflows/release.yaml @@ -0,0 +1,30 @@ +--- +name: Build release + +on: + release: + types: [created] + +jobs: + release-linux-amd64: + name: release linux/amd64 + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - uses: wangyoucao577/go-release-action@master + with: + github_token: ${{ secrets.GITHUB_TOKEN }} + goos: linux + goarch: amd64 + binary_name: subjack + release-darwin-amd64: + name: release darwin/amd64 + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - uses: wangyoucao577/go-release-action@master + with: + github_token: ${{ secrets.GITHUB_TOKEN }} + goos: darwin + goarch: amd64 + binary_name: subjack