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
2 changes: 2 additions & 0 deletions .changes/header.tpl.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# Changelog
All notable changes to this project will be documented in this file.
Empty file added .changes/unreleased/.gitkeep
Empty file.
6 changes: 6 additions & 0 deletions .changes/unreleased/Added-20250401-003545.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
kind: Added
body: Added `emit_classes` config option that, if enabled, puts all the queries into classes
time: 2025-04-01T00:35:45.5676193+02:00
custom:
Author: rayakame
PR: "13"
6 changes: 6 additions & 0 deletions .changes/unreleased/Added-20250401-004659.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
kind: Added
body: Added changelog functionality
time: 2025-04-01T00:46:59.2722211+02:00
custom:
Author: rayakame
PR: "14"
34 changes: 34 additions & 0 deletions .changie.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
changesDir: .changes
unreleasedDir: unreleased
headerPath: header.tpl.md
changelogPath: CHANGELOG.md
versionExt: md
versionFormat: '## {{.Version}} - {{.Time.Format "2006-01-02"}}'
kindFormat: '### {{.Kind}}'
changeFormat: '* [#{{.Custom.PR}}](https://github.com/rayakame/sqlc-gen-better-python/pull/{{.Custom.PR}}) {{.Body}} ({{.Custom.Author}})'
custom:
- key: PR
type: int
minInt: 1
- key: Author
label: GitHub Name
type: string
minLength: 3
kinds:
- label: Added
auto: minor
- label: Changed
auto: major
- label: Deprecated
auto: minor
- label: Removed
auto: major
- label: Fixed
auto: patch
- label: Security
auto: patch
newlines:
afterChangelogHeader: 1
beforeChangelogVersion: 1
endOfVersion: 1
envPrefix: CHANGIE_
40 changes: 40 additions & 0 deletions .github/workflows/fragments-check.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
name: Fragments check

on:
pull_request:
types: [labeled, unlabeled, opened, reopened, synchronize]
branches:
- main

jobs:
check-fragment-added:
if: github.event.pull_request.user.type != 'Bot' && !contains(github.event.pull_request.labels.*.name, 'skip-fragment-check')
runs-on: ubuntu-latest


steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: '0'

- name: Check if linked to the correct pull request
run: |
diff=$(git diff origin/${{ github.base_ref }} HEAD --name-only)
changelog_fragments=$(echo "$diff" | grep "^.changes/unreleased/.*\.yaml$")
pr_number=${{ github.event.pull_request.number }}
found_match=false

for file in $changelog_fragments; do
if grep -qE "PR: *\"?$pr_number\"?" "$file"; then
echo "✅ Found PR number $pr_number in $file"
found_match=true
fi
done

if [ "$found_match" = false ]; then
echo "❌ No matching PR number found in changelog fragments."
exit 1
fi


55 changes: 55 additions & 0 deletions .github/workflows/prepare_release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
name: Prepare Release

on:
workflow_dispatch:
inputs:
version:
description: 'The version to prepare the release for'
required: true
type: choice
options:
- major
- minor
- patch

jobs:
generate-pr:
runs-on: ubuntu-latest
if: github.ref == 'refs/heads/master'

steps:
- name: Checkout
uses: actions/checkout@v4

- name: Batch changes
uses: miniscruff/changie-action@v2
with:
version: latest
args: batch ${{ github.event.inputs.version }}

- name: Merge changes
uses: miniscruff/changie-action@v2
with:
version: latest
args: merge

- name: Get the latest version
id: latest
uses: miniscruff/changie-action@v2
with:
version: latest
args: latest

- name: Set version
run: |
sed -i 's/^const PluginVersion = ".*"/const PluginVersion = "'"${{ steps.latest.outputs.output }}"'"/' internal/core/config.go

echo "✅ Updated PluginVersion to $new_version"


- name: Create Pull Request
uses: peter-evans/create-pull-request@v4
with:
title: Release ${{ steps.latest.outputs.output }}
branch: release/${{ steps.latest.outputs.output }}
commit-message: Release ${{ steps.latest.outputs.output }}
Empty file added CHANGELOG.md
Empty file.