From 24b0d34d0161f16f33840e94466c5466cf8bb2a6 Mon Sep 17 00:00:00 2001 From: aereal Date: Sat, 25 Sep 2021 14:23:45 +0900 Subject: [PATCH] build: release with semantic-release --- .github/workflows/ci.yml | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index b44b015..674f9a2 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -30,3 +30,29 @@ jobs: go-version: ${{ matrix.go_version }} - name: test run: go test -v -race -cover -covermode=atomic ./... + release: + if: github.ref == 'refs/heads/main' + runs-on: ubuntu-latest + needs: + - test + - lint + steps: + - uses: actions/checkout@v2 + - uses: actions/setup-node@v2 + with: + node-version: '16.x' + - uses: actions/cache@v2 + with: + path: ~/.npm + key: ${{ runner.os }}-npm + restore-keys: | + ${{ runner.os }}-npm + - run: | + npx semantic-release \ + --debug \ + --branches main \ + --plugins @semantic-release/commit-analyzer \ + --plugins @semantic-release/release-notes-generator \ + --plugins @semantic-release/github + env: + GITHUB_TOKEN: ${{ github.token }}