diff --git a/.github/workflows/release-please.yml b/.github/workflows/release-please.yml new file mode 100644 index 0000000..529b7b5 --- /dev/null +++ b/.github/workflows/release-please.yml @@ -0,0 +1,51 @@ +on: + push: + branches: + - main + +permissions: + contents: write + issues: write + pull-requests: write + +name: release-please + +jobs: + release-please: + runs-on: ubuntu-latest + steps: + - uses: googleapis/release-please-action@v4 + id: release + with: + token: ${{ secrets.GITHUB_TOKEN }} + + # Optional: Build and attach binaries to the release + - uses: actions/checkout@v4 + if: ${{ steps.release.outputs.release_created }} + + - uses: actions/setup-go@v4 + with: + go-version-file: 'go.mod' + if: ${{ steps.release.outputs.release_created }} + + - name: Build binaries + if: ${{ steps.release.outputs.release_created }} + run: | + # Build for multiple platforms + GOOS=linux GOARCH=amd64 go build -o notion-md-linux-amd64 ./cmd/notion-md + GOOS=linux GOARCH=arm64 go build -o notion-md-linux-arm64 ./cmd/notion-md + GOOS=darwin GOARCH=amd64 go build -o notion-md-darwin-amd64 ./cmd/notion-md + GOOS=darwin GOARCH=arm64 go build -o notion-md-darwin-arm64 ./cmd/notion-md + GOOS=windows GOARCH=amd64 go build -o notion-md-windows-amd64.exe ./cmd/notion-md + + - name: Upload Release Artifacts + if: ${{ steps.release.outputs.release_created }} + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + run: | + gh release upload ${{ steps.release.outputs.tag_name }} \ + notion-md-linux-amd64 \ + notion-md-linux-arm64 \ + notion-md-darwin-amd64 \ + notion-md-darwin-arm64 \ + notion-md-windows-amd64.exe \ No newline at end of file diff --git a/.release-please-manifest.json b/.release-please-manifest.json new file mode 100644 index 0000000..3d2ac0b --- /dev/null +++ b/.release-please-manifest.json @@ -0,0 +1,3 @@ +{ + ".": "0.1.0" +} \ No newline at end of file diff --git a/CHANGELOG.md b/CHANGELOG.md new file mode 100644 index 0000000..0e07e46 --- /dev/null +++ b/CHANGELOG.md @@ -0,0 +1,6 @@ +# Changelog + +All notable changes to this project will be documented in this file. + +The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), +and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). \ No newline at end of file diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 0e2e2f9..808716e 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -2,6 +2,45 @@ Thank you for your interest in contributing to md2notion! This document provides guidelines and instructions for contributing. +## Commit Message Guidelines + +This project uses [Conventional Commits](https://www.conventionalcommits.org/) to automate releases and changelog generation. Please format your commit messages as follows: + +``` +[optional scope]: + +[optional body] + +[optional footer(s)] +``` + +### Commit Types + +- `feat:` - A new feature (correlates to a SemVer minor version bump) +- `fix:` - A bug fix (correlates to a SemVer patch version bump) +- `docs:` - Documentation only changes +- `style:` - Changes that do not affect the meaning of the code (white-space, formatting, etc.) +- `refactor:` - A code change that neither fixes a bug nor adds a feature +- `perf:` - A code change that improves performance +- `test:` - Adding missing tests or correcting existing tests +- `build:` - Changes that affect the build system or external dependencies +- `ci:` - Changes to our CI configuration files and scripts +- `chore:` - Other changes that don't modify src or test files +- `revert:` - Reverts a previous commit + +### Breaking Changes + +For breaking changes, add a `!` after the type/scope: `feat!:` or add `BREAKING CHANGE:` in the footer. + +### Examples + +``` +feat: add support for nested lists in markdown conversion +fix: resolve issue with image URL handling +docs: update README with new installation instructions +feat!: change API response format for better consistency +``` + ## Development Setup ### Prerequisites diff --git a/release-please-config.json b/release-please-config.json new file mode 100644 index 0000000..d134ace --- /dev/null +++ b/release-please-config.json @@ -0,0 +1,22 @@ +{ + "release-type": "go", + "bump-minor-pre-major": true, + "bump-patch-for-minor-pre-major": true, + "changelog-sections": [ + {"type": "feat", "section": "Features"}, + {"type": "fix", "section": "Bug Fixes"}, + {"type": "perf", "section": "Performance Improvements"}, + {"type": "revert", "section": "Reverts"}, + {"type": "docs", "section": "Documentation"}, + {"type": "style", "section": "Styles", "hidden": true}, + {"type": "refactor", "section": "Code Refactoring"}, + {"type": "test", "section": "Tests", "hidden": true}, + {"type": "build", "section": "Build System", "hidden": true}, + {"type": "ci", "section": "Continuous Integration", "hidden": true} + ], + "packages": { + ".": { + "package-name": "markdown-to-notionapi" + } + } +} \ No newline at end of file