From 5c17919330a79b850007ffc85cadab32c31365e8 Mon Sep 17 00:00:00 2001 From: Florian Forster Date: Fri, 15 Nov 2019 15:33:35 +0100 Subject: [PATCH] add sematic-release --- .github/workflows/release.yml | 16 +++++----------- .github/workflows/test.yml | 5 ++++- releaserc.js | 7 +++++++ 3 files changed, 16 insertions(+), 12 deletions(-) create mode 100644 releaserc.js diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 0d2192b..c63dbca 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -2,7 +2,7 @@ name: Release on: push: branches: - - master + - master jobs: build: runs-on: ubuntu-18.04 @@ -20,13 +20,7 @@ jobs: release: runs-on: ubuntu-18.04 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 index f5e9c29..ab4fc61 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -1,5 +1,8 @@ name: Test & Build -on: push +on: + push: + branches-ignore: + - master jobs: build: runs-on: ubuntu-18.04 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