diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..ba71565 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,19 @@ +name: Release +on: push +jobs: + release: + runs-on: ubuntu-18.04 + steps: + - name: Source checkout + uses: actions/checkout@v1 + with: + fetch-depth: 1 + - name: Release + shell: bash + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + 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 + echo "Insert Go test & Build Here" ## Insert Go test & Build Here + npx semantic-release \ No newline at end of file