Skip to content

feat: comment improvements — body-file, @mentions, docs fix (#33) #3

feat: comment improvements — body-file, @mentions, docs fix (#33)

feat: comment improvements — body-file, @mentions, docs fix (#33) #3

Workflow file for this run

name: Release
on:
push:
tags:
- 'v*'
permissions:
contents: write
jobs:
release:
name: Release
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v6
with:
fetch-depth: 0
- name: Set up Go
uses: actions/setup-go@v6
with:
go-version-file: ./go.mod
cache: true
- name: Run tests
run: go test -v -race ./...
- name: Build binaries
run: |
VERSION=${GITHUB_REF_NAME}
COMMIT=$(git rev-parse --short HEAD)
DATE=$(date -u +"%Y-%m-%dT%H:%M:%SZ")
LDFLAGS="-s -w -X main.version=${VERSION} -X main.commit=${COMMIT} -X main.date=${DATE}"
mkdir -p dist
# Build for each platform
platforms=(
"linux/amd64"
"linux/arm64"
"darwin/amd64"
"darwin/arm64"
"windows/amd64"
"windows/arm64"
)
for platform in "${platforms[@]}"; do
GOOS=${platform%/*}
GOARCH=${platform#*/}
output_name="atl-${GOOS}-${GOARCH}"
if [ "$GOOS" = "windows" ]; then
output_name+=".exe"
fi
echo "Building $output_name..."
GOOS=$GOOS GOARCH=$GOARCH go build -ldflags "${LDFLAGS}" -o "dist/${output_name}" ./cmd/atl
done
# Create archives
cd dist
for file in atl-*; do
if [[ "$file" == *.exe ]]; then
zip "${file%.exe}.zip" "$file"
rm "$file"
else
tar czf "${file}.tar.gz" "$file"
rm "$file"
fi
done
# Generate checksums
sha256sum * > checksums.txt
- name: Generate changelog
id: changelog
run: |
# Get previous tag
PREV_TAG=$(git describe --tags --abbrev=0 HEAD^ 2>/dev/null || echo "")
if [ -n "$PREV_TAG" ]; then
echo "Generating changelog from $PREV_TAG to $GITHUB_REF_NAME"
CHANGELOG=$(git log --pretty=format:"- %s (%h)" "$PREV_TAG".."$GITHUB_REF_NAME" --no-merges)
else
echo "No previous tag found, including all commits"
CHANGELOG=$(git log --pretty=format:"- %s (%h)" --no-merges)
fi
# Escape for GitHub Actions
echo "changelog<<EOF" >> $GITHUB_OUTPUT
echo "$CHANGELOG" >> $GITHUB_OUTPUT
echo "EOF" >> $GITHUB_OUTPUT
- name: Create Release
uses: softprops/action-gh-release@v2
with:
name: ${{ github.ref_name }}
body: |
## What's Changed
${{ steps.changelog.outputs.changelog }}
## Installation
### macOS (Apple Silicon)
```bash
curl -L https://github.com/${{ github.repository }}/releases/download/${{ github.ref_name }}/atl-darwin-arm64.tar.gz | tar xz
chmod +x atl-darwin-arm64
sudo mv atl-darwin-arm64 /usr/local/bin/atl
```
### macOS (Intel)
```bash
curl -L https://github.com/${{ github.repository }}/releases/download/${{ github.ref_name }}/atl-darwin-amd64.tar.gz | tar xz
chmod +x atl-darwin-amd64
sudo mv atl-darwin-amd64 /usr/local/bin/atl
```
### Linux (x64)
```bash
curl -L https://github.com/${{ github.repository }}/releases/download/${{ github.ref_name }}/atl-linux-amd64.tar.gz | tar xz
chmod +x atl-linux-amd64
sudo mv atl-linux-amd64 /usr/local/bin/atl
```
### Windows
Download `atl-windows-amd64.zip` (or `atl-windows-arm64.zip` for ARM) and add to your PATH.
## Checksums
See `checksums.txt` for SHA256 checksums of all binaries.
files: |
dist/*
draft: false
prerelease: ${{ contains(github.ref_name, '-') }}