add sematic-release (#3)
* add sematic-release * refactor * job release depends on job test * seperate step * add badge
This commit is contained in:
parent
94a4ac9068
commit
ed04290a62
4 changed files with 30 additions and 32 deletions
38
.github/workflows/release.yml
vendored
38
.github/workflows/release.yml
vendored
|
@ -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 }}
|
16
.github/workflows/test.yml
vendored
16
.github/workflows/test.yml
vendored
|
@ -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
|
|
@ -1,5 +1,6 @@
|
|||
# oidc
|
||||
|
||||
[]
|
||||

|
||||
|
||||
OpenID Connect SDK (client and server) for Go
|
||||
|
|
7
releaserc.js
Normal file
7
releaserc.js
Normal file
|
@ -0,0 +1,7 @@
|
|||
module.exports = {
|
||||
branch: 'master',
|
||||
plugins: [
|
||||
"@semantic-release/commit-analyzer",
|
||||
"@semantic-release/release-notes-generator"
|
||||
]
|
||||
};
|
Loading…
Add table
Add a link
Reference in a new issue