From 360e2e5d7d21249a0c3c64d675d33420931caceb Mon Sep 17 00:00:00 2001 From: Moritz Johner Date: Fri, 30 Sep 2022 19:52:39 +0200 Subject: [PATCH] feat: add ci Signed-off-by: Moritz Johner --- .github/workflows/ci.yml | 24 +++++++++++++++++++ .github/workflows/release.yml | 44 +++++++++++++++++++++++++++++++++++ 2 files changed, 68 insertions(+) create mode 100644 .github/workflows/ci.yml create mode 100644 .github/workflows/release.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..ae86223 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,24 @@ +name: ci + +on: + pull_request: + push: + branches: + - 'main' + +jobs: + build: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v3 + + - uses: actions/setup-go@v3 + with: + go-version-file: 'go.mod' + + - name: test + run: go test -v ./... + + - name: build + run: go build -o kes2eso main.go diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..5fc1f21 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,44 @@ +name: release + +on: + push: + tags: + - 'v*.*.*' + +jobs: + release: + if: startsWith(github.ref, 'refs/tags/') + runs-on: ubuntu-latest + steps: + - name: Create Release + uses: softprops/action-gh-release@v1 + with: + generate_release_notes: true + + releases-matrix: + name: Release Go Binary + runs-on: ubuntu-latest + permissions: + packages: write + id-token: write + strategy: + matrix: + goos: [linux, windows, darwin] + goarch: [amd64, arm64] + exclude: + - goarch: "386" + goos: darwin + - goarch: arm64 + goos: windows + steps: + - name: Checkout + uses: actions/checkout@v3 + + - name: Release binary + uses: wangyoucao577/go-release-action@v1.31 + with: + github_token: ${{ secrets.GITHUB_TOKEN }} + release_tag: ${{ github.ref_name }} + goos: ${{ matrix.goos }} + goarch: ${{ matrix.goarch }} + goversion: "https://dl.google.com/go/go1.19.1.linux-amd64.tar.gz"