Skip to content
Merged
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
35 changes: 5 additions & 30 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,33 +14,17 @@ jobs:
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Set up Go
uses: actions/setup-go@v5
with:
go-version-file: go.mod

- name: Run tests
run: go test ./...
- name: Vet
run: go vet ./...

- name: Generate changelog
id: changelog
run: |
# Get the previous tag
PREV_TAG=$(git describe --tags --abbrev=0 HEAD^ 2>/dev/null || echo "")

if [ -z "$PREV_TAG" ]; then
echo "notes=Initial release" >> $GITHUB_OUTPUT
else
# Generate changelog from commits since last tag
NOTES=$(git log --pretty=format:"- %s (%h)" $PREV_TAG..HEAD^ | head -50)
# Use a delimiter for multiline output
echo "notes<<EOF" >> $GITHUB_OUTPUT
echo "$NOTES" >> $GITHUB_OUTPUT
echo "EOF" >> $GITHUB_OUTPUT
fi
- name: Run tests
run: go test -race -count=1 ./...

- name: Determine if prerelease
id: prerelease
Expand All @@ -56,16 +40,7 @@ jobs:
- name: Create GitHub Release
uses: softprops/action-gh-release@v2
with:
body: |
## Changes

${{ steps.changelog.outputs.notes }}

## Installation

```bash
go get github.com/ecadlabs/gotez/v2@${{ github.ref_name }}
```
generate_release_notes: true
draft: false
prerelease: ${{ steps.prerelease.outputs.is_prerelease == 'true' }}
env:
Expand Down
8 changes: 7 additions & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@ on:
pull_request:
branches: [v2]

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
test:
runs-on: ubuntu-latest
Expand All @@ -16,4 +20,6 @@ jobs:
with:
go-version-file: go.mod

- run: go test ./...
- run: go vet ./...

- run: go test -race -count=1 ./...