Fix/endpoint (#112) #28
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: CD | |
on: | |
push: | |
tags: | |
- 'v*' | |
jobs: | |
goreleaser: | |
name: Publish Release | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 | |
- name: Set up Go | |
uses: actions/setup-go@v3 | |
with: | |
go-version-file: 'go.mod' | |
- name: Check code format | |
run: make gofmt_check | |
- name: Run tests | |
run: make test | |
- name: Run GoReleaser | |
uses: goreleaser/goreleaser-action@v3 | |
with: | |
version: latest | |
args: release --rm-dist | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
if: success() | |
- name: Get the new version | |
id: new_version | |
run: echo ::set-output name=VERSION::$(git tag --list "v*" --sort=version:refname | tail -n 1) | |
- name: Get the old version | |
id: old_version | |
run: echo ::set-output name=VERSION::$(git tag --list "v*" --sort=version:refname | tail -n 2 | head -n 1) | |
- name: Check version | |
run: | | |
/usr/bin/bash ./scripts/git-versioning.sh ${{ steps.new_version.outputs.VERSION }} ${{ steps.old_version.outputs.VERSION }} |