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
44 changes: 44 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
name: Release

on:
push:
tags:
- 'v*'

permissions:
contents: write

jobs:
release:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4

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

- name: Build binaries
run: |
# Create dist directory
mkdir -p dist

# Build for multiple platforms
GOOS=linux GOARCH=amd64 go build -o dist/md_split-linux-amd64 .
GOOS=linux GOARCH=arm64 go build -o dist/md_split-linux-arm64 .
GOOS=darwin GOARCH=amd64 go build -o dist/md_split-darwin-amd64 .
GOOS=darwin GOARCH=arm64 go build -o dist/md_split-darwin-arm64 .
GOOS=windows GOARCH=amd64 go build -o dist/md_split-windows-amd64.exe .
GOOS=windows GOARCH=arm64 go build -o dist/md_split-windows-arm64.exe .

- name: Create Release
uses: softprops/action-gh-release@v2
with:
files: dist/*
generate_release_notes: true
draft: false
prerelease: false
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@
# Main binary
md_split

# Build artifacts
dist/

# Test binary, built with `go test -c`
*.test

Expand Down
7 changes: 7 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,13 @@ cd md_split
go build -o md_split
```

### Pre-built Binaries

Alternatively, you can download pre-built binaries from the [Releases page](https://github.com/liamgallear/md_split/releases). Binaries are available for:
- Linux (AMD64, ARM64)
- macOS (AMD64, ARM64)
- Windows (AMD64, ARM64)

## Usage

The tool provides two main commands: `split` and `merge`.
Expand Down
32 changes: 32 additions & 0 deletions RELEASES.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# Creating Releases

This repository uses GitHub Actions to automatically create releases when a new version tag is pushed.

## How to Create a Release

1. Make sure all changes are committed and pushed to the main branch
2. Create and push a version tag:
```bash
git tag v1.0.0
git push origin v1.0.0
```
3. The GitHub Actions workflow will automatically:
- Build binaries for multiple platforms (Linux, macOS, Windows on AMD64 and ARM64)
- Create a GitHub release with auto-generated release notes
- Attach all built binaries as downloadable assets

## Version Tagging Convention

- Use semantic versioning (e.g., `v1.0.0`, `v1.2.3`, `v2.0.0-beta.1`)
- Always prefix tags with `v` (e.g., `v1.0.0` not `1.0.0`)
- The workflow is triggered by any tag that starts with `v`

## Built Artifacts

The release workflow creates the following binary artifacts:
- `md_split-linux-amd64`
- `md_split-linux-arm64`
- `md_split-darwin-amd64` (macOS Intel)
- `md_split-darwin-arm64` (macOS Apple Silicon)
- `md_split-windows-amd64.exe`
- `md_split-windows-arm64.exe`