Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
47 changes: 47 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
name: Automated Release
on:
push:
tags:
- 'v*'
jobs:
test:
name: Run Unit Tests
runs-on: ubuntu-latest
strategy:
fail-fast: true
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: 1.24.0
- name: Display the version of go that we have installed
run: go version
release:
name: Release
runs-on: ubuntu-latest
needs: test
permissions:
contents: write
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: 1.24.0
- name: Display the version of go that we have installed
run: go version
- name: Extract tag version
id: get_tag
run: echo "version=${GITHUB_REF#refs/tags/}" >> $GITHUB_OUTPUT
- name: Create GitHub Release with Notes
id: create_release
uses: softprops/action-gh-release@v2
with:
tag_name: ${{ steps.get_tag.outputs.version }}
name: Release ${{ steps.get_tag.outputs.version }}
generate_release_notes: true
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
5 changes: 5 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,11 @@ unittest:
unittestwithcover:
$(GOFOLDERS) | xargs $(GO) test -cover $(GOTEST_FLAGS) -timeout=$(TEST_TIMEOUT) -run UnitTest$

# To create a new release: `make release VERSION=v0.2.0`
release:
git tag $(VERSION)
git push origin $(VERSION)

COVER_PKGS := `find . -name '*_test.go' ! -path "./.git/*" ! -path "./Godeps/*" ! -path "./vendor/*" | xargs -I{} dirname {} | sort -u`
coverdata:
echo 'mode: $(COVER_MODE)' > $(COVER_TMPFILE)
Expand Down