add sematic-release (#3)

* add sematic-release

* refactor

* job release depends on job test

* seperate step

* add badge
This commit is contained in:
Florian Forster 2019-11-15 15:49:56 +01:00 committed by GitHub
parent 94a4ac9068
commit ed04290a62
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 30 additions and 32 deletions

View file

@ -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
- name: Semantic Release
uses: cycjimmy/semantic-release-action@v2
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

View file

@ -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

View file

@ -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

7
releaserc.js Normal file
View file

@ -0,0 +1,7 @@
module.exports = {
branch: 'master',
plugins: [
"@semantic-release/commit-analyzer",
"@semantic-release/release-notes-generator"
]
};