diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..f400fa3 --- /dev/null +++ b/.github/workflows/release.yml @@ -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 }} \ No newline at end of file diff --git a/.gitignore b/.gitignore index 1ba5e44..4a102cc 100644 --- a/.gitignore +++ b/.gitignore @@ -11,6 +11,9 @@ # Main binary md_split +# Build artifacts +dist/ + # Test binary, built with `go test -c` *.test diff --git a/README.md b/README.md index df768bf..3bcfefe 100644 --- a/README.md +++ b/README.md @@ -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`. diff --git a/RELEASES.md b/RELEASES.md new file mode 100644 index 0000000..e83e465 --- /dev/null +++ b/RELEASES.md @@ -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` \ No newline at end of file