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