diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 0d2192b..42e6685 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -1,15 +1,26 @@ name: Release -on: - push: - branches: - - master +on: push jobs: - build: + test: runs-on: ubuntu-18.04 strategy: matrix: go: ['1.11', '1.12', '1.13'] - name: Go ${{ matrix.go }} sample + name: Go ${{ matrix.go }} test + steps: + - uses: actions/checkout@master + - name: Setup go + uses: actions/setup-go@v1 + with: + go-version: ${{ matrix.go }} + - run: go run main.go + build: + runs-on: ubuntu-18.04 + needs: test + strategy: + matrix: + go: ['1.11', '1.12', '1.13'] + name: Go ${{ matrix.go }} build steps: - uses: actions/checkout@master - name: Setup go @@ -19,14 +30,9 @@ jobs: - run: go run main.go release: runs-on: ubuntu-18.04 + needs: [test, build] steps: - - name: Source checkout - uses: actions/checkout@v1 - with: - fetch-depth: 1 - - name: Release - shell: bash - run: | - export GIT_TAG="v$(npx semantic-release --dry-run --plugins=@semantic-release/commit-analyzer --analize-commits | grep "The next release version is" | sed -ne 's/.*The\ next\ release\ version\ is\ \([0-9]\+\.[0-9]\+\.[0-9]\+\)$/\1/p')" - [[ "$GIT_TAG" == "v" ]] && echo "Exiting, as no new version needs to be released" && exit 0 - npx semantic-release \ No newline at end of file + - name: Semantic Release + uses: cycjimmy/semantic-release-action@v2 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} \ No newline at end of file diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml deleted file mode 100644 index f5e9c29..0000000 --- a/.github/workflows/test.yml +++ /dev/null @@ -1,16 +0,0 @@ -name: Test & Build -on: push -jobs: - build: - runs-on: ubuntu-18.04 - strategy: - matrix: - go: ['1.11', '1.12', '1.13'] - name: Go ${{ matrix.go }} sample - steps: - - uses: actions/checkout@master - - name: Setup go - uses: actions/setup-go@v1 - with: - go-version: ${{ matrix.go }} - - run: go run main.go \ No newline at end of file diff --git a/README.md b/README.md index 1498fd6..4d372dd 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,6 @@ # oidc +[![semantic-release](https://img.shields.io/badge/%20%20%F0%9F%93%A6%F0%9F%9A%80-semantic--release-e10079.svg)] ![Release Badge](https://github.com/caos/oidc/workflows/Release/badge.svg) OpenID Connect SDK (client and server) for Go diff --git a/releaserc.js b/releaserc.js new file mode 100644 index 0000000..cf2f499 --- /dev/null +++ b/releaserc.js @@ -0,0 +1,7 @@ +module.exports = { + branch: 'master', + plugins: [ + "@semantic-release/commit-analyzer", + "@semantic-release/release-notes-generator" + ] + }; \ No newline at end of file