From 72b9bf5f3d44129ca3680824abe9a1ff0cd06c6b Mon Sep 17 00:00:00 2001 From: Qing Ye Date: Tue, 21 Sep 2021 13:59:08 +0800 Subject: [PATCH] add github actions --- .github/workflows/build-and-test.yml | 29 +++++++++++++++++++++++++++ .github/workflows/release.yml | 30 ++++++++++++++++++++++++++++ examples/README.md | 2 +- 3 files changed, 60 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/build-and-test.yml create mode 100644 .github/workflows/release.yml diff --git a/.github/workflows/build-and-test.yml b/.github/workflows/build-and-test.yml new file mode 100644 index 0000000..1632db6 --- /dev/null +++ b/.github/workflows/build-and-test.yml @@ -0,0 +1,29 @@ +name: build-and-test + +on: + push: + branches: [ $default-branch ] + pull_request: + branches: [ $default-branch ] + +jobs: + build-and-test: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + + - name: Set up Go + uses: actions/setup-go@v2 + with: + go-version: 1.17 + + - name: Shell check + uses: ludeeus/action-shellcheck@master + with: + scandir: './scripts' + + - name: Vet + run: go vet ./... + + - name: Build + run: go build -v ./... diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..bcca058 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,30 @@ +name: release + +on: + push: + tags: + - '*' + +permissions: + contents: write + +jobs: + goreleaser: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v2 + with: + fetch-depth: 0 + - name: Set up Go + uses: actions/setup-go@v2 + with: + go-version: 1.17 + - name: Run GoReleaser + uses: goreleaser/goreleaser-action@v2 + with: + distribution: goreleaser + version: latest + args: release --rm-dist + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/examples/README.md b/examples/README.md index 7ae7c33..3e54396 100644 --- a/examples/README.md +++ b/examples/README.md @@ -22,7 +22,7 @@ Install Infrabin helm upgrade -i infrabin --set image.tag=0.9.0 -f ./infrabin.yml ./charts/infrabin ``` -Upgrade Infrabin +Upgrade Infrabin (to create a new release) ```shell helm upgrade -i infrabin --set image.tag=0.9.1 -f ./infrabin.yml ./charts/infrabin ```