From 214cd90f0b9d1f6dec61d43e1e5a814c80dadea7 Mon Sep 17 00:00:00 2001 From: Kevin Marilleau Date: Sun, 28 Feb 2021 19:11:23 +0100 Subject: [PATCH] feat(test): add semantic-release --- .github/workflows/ci.yml | 39 ++++++++++++++++++++++++++++++++++++++ .github/workflows/test.yml | 20 ------------------- .releaserc.json | 13 +++++++++++++ 3 files changed, 52 insertions(+), 20 deletions(-) create mode 100644 .github/workflows/ci.yml delete mode 100644 .github/workflows/test.yml create mode 100644 .releaserc.json diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..9946865 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,39 @@ +name: CI + +on: [push, pull_request] + +jobs: + test: + name: Test + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v2 + + - name: Set up Go + uses: actions/setup-go@v2 + with: + go-version: 1.15 + + - name: Install Go Dependencies + run: go mod download + + - name: Test + run: go test -v . + + release: + name: Release + runs-on: ubuntu-latest + needs: test + + steps: + - uses: actions/checkout@v2 + + - uses: actions/setup-node@v1 + with: + node-version: 12 + + - name: Release + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + run: npx semantic-release \ No newline at end of file diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml deleted file mode 100644 index 2a3f8b2..0000000 --- a/.github/workflows/test.yml +++ /dev/null @@ -1,20 +0,0 @@ -name: Test - -on: [push, pull_request] - -jobs: - unit: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v2 - - - name: Set up Go - uses: actions/setup-go@v2 - with: - go-version: 1.15 - - - name: Install Go Dependencies - run: go mod download - - - name: Test - run: go test -v ./... diff --git a/.releaserc.json b/.releaserc.json new file mode 100644 index 0000000..a0ba2d1 --- /dev/null +++ b/.releaserc.json @@ -0,0 +1,13 @@ +{ + "branches": [ + "main", { + "name": "beta", + "prerelease": true + } + ], + "plugins": [ + "@semantic-release/commit-analyzer", + "@semantic-release/release-notes-generator", + "@semantic-release/github" + ] +} \ No newline at end of file