From 58136f8098bf6a6aecd1d4dcc5d67851b296268c Mon Sep 17 00:00:00 2001 From: Ryo Kitagawa Date: Sat, 12 Jun 2021 20:49:23 +0900 Subject: [PATCH] Add github actions --- .github/workflows/release.yaml | 25 +++++++++++++++++++++++++ .github/workflows/test.yaml | 32 ++++++++++++++++++++++++++++++++ 2 files changed, 57 insertions(+) create mode 100644 .github/workflows/release.yaml create mode 100644 .github/workflows/test.yaml diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml new file mode 100644 index 0000000..574980a --- /dev/null +++ b/.github/workflows/release.yaml @@ -0,0 +1,25 @@ +on: + release: + types: [created] + +jobs: + releases-matrix: + name: Release Go Binary + runs-on: ubuntu-latest + strategy: + matrix: + # build and publish in parallel: linux/386, linux/amd64, windows/386, windows/amd64, darwin/amd64 + goos: [linux, windows, darwin] + goarch: ["386", amd64] + exclude: + - goarch: "386" + goos: darwin + steps: + - uses: actions/checkout@v2 + - uses: wangyoucao577/go-release-action@v1.18 + with: + github_token: ${{ secrets.GITHUB_TOKEN }} + goos: ${{ matrix.goos }} + goarch: ${{ matrix.goarch }} + project_path: "./" + binary_name: "kj" diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml new file mode 100644 index 0000000..d9cf4a1 --- /dev/null +++ b/.github/workflows/test.yaml @@ -0,0 +1,32 @@ +name: Test + +on: + push: + branches: + - main + pull_request: + branches: + - main + +jobs: + build: + name: Build + runs-on: ubuntu-latest + steps: + + - name: Set up Go 1.x + uses: actions/setup-go@v2 + with: + go-version: ^1.16 + id: go + + - name: Check out code into the Go module directory + uses: actions/checkout@v2 + + - name: Get dependencies + run: | + go mod download + + - name: Test + run: | + go test ./...