Skip to content

Commit 134bfe4

Browse files
committed
Fix org references, add release workflow, CHANGELOG, dependabot
- Update all endstone-insider/dwarf2cpp URLs to EndstoneMC/dwarf2cpp - Update checkout@v5 to v6 - Add release workflow with version input, dry run, changelog extraction, cibuildwheel builds on 3 platforms, artifact attachment - Add CHANGELOG.md with [Unreleased] section - Add dependabot for github-actions
1 parent 7f72fe4 commit 134bfe4

File tree

5 files changed

+154
-3
lines changed

5 files changed

+154
-3
lines changed

.github/dependabot.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
version: 2
2+
updates:
3+
- package-ecosystem: "github-actions"
4+
directory: "/"
5+
schedule:
6+
interval: "weekly"

.github/workflows/build.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ jobs:
1313
os: [ ubuntu-latest, windows-latest, macos-14 ]
1414

1515
steps:
16-
- uses: actions/checkout@v5
16+
- uses: actions/checkout@v6
1717

1818
- name: Build wheels
1919
uses: pypa/cibuildwheel@v3.1.4

.github/workflows/release.yml

Lines changed: 129 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,129 @@
1+
name: Release
2+
3+
on:
4+
workflow_dispatch:
5+
inputs:
6+
version:
7+
description: "Version to release (e.g. 0.2.0)"
8+
required: true
9+
type: string
10+
dry_run:
11+
description: "Preview without making changes"
12+
required: false
13+
type: boolean
14+
default: false
15+
16+
jobs:
17+
release:
18+
if: github.repository == 'EndstoneMC/dwarf2cpp'
19+
runs-on: ubuntu-latest
20+
permissions:
21+
contents: write
22+
steps:
23+
- name: Checkout Code
24+
uses: actions/checkout@v6
25+
with:
26+
fetch-depth: 0
27+
28+
- name: Validate version
29+
run: |
30+
VERSION="${{ inputs.version }}"
31+
if [[ ! "$VERSION" =~ ^[0-9]+\.[0-9]+\.[0-9]+$ ]]; then
32+
echo "::error::Invalid version format: $VERSION (expected X.Y.Z)"
33+
exit 1
34+
fi
35+
if git tag -l "v$VERSION" | grep -q .; then
36+
echo "::error::Tag v$VERSION already exists"
37+
exit 1
38+
fi
39+
echo "VERSION=$VERSION" >> "$GITHUB_ENV"
40+
41+
- name: Extract unreleased changelog
42+
run: |
43+
BODY=$(sed -n '/^## \[Unreleased\]/,/^## \[/{/^## \[/d; p}' CHANGELOG.md)
44+
BODY=$(echo "$BODY" | sed '/./,$!d' | sed -e :a -e '/^\n*$/{$d;N;ba}')
45+
if [ -z "$BODY" ]; then
46+
echo "::error::Unreleased section in CHANGELOG.md is empty"
47+
exit 1
48+
fi
49+
echo "$BODY" > /tmp/release_body.md
50+
echo "Extracted changelog:"
51+
echo "$BODY"
52+
53+
- name: Preview
54+
if: inputs.dry_run
55+
run: |
56+
DATE=$(date -u +%Y-%m-%d)
57+
echo "=== Dry Run ==="
58+
echo "Version: $VERSION"
59+
echo "Tag: v$VERSION"
60+
echo "Date: $DATE"
61+
echo ""
62+
echo "=== Release Body ==="
63+
cat /tmp/release_body.md
64+
65+
- name: Update version in pyproject.toml
66+
if: ${{ !inputs.dry_run }}
67+
run: sed -i "s/^version = \".*\"/version = \"$VERSION\"/" pyproject.toml
68+
69+
- name: Update CHANGELOG.md
70+
if: ${{ !inputs.dry_run }}
71+
run: |
72+
DATE=$(date -u +%Y-%m-%d)
73+
sed -i "s/^## \[Unreleased\]/## [Unreleased]\n\n## [$VERSION] - $DATE/" CHANGELOG.md
74+
75+
- name: Commit and tag
76+
if: ${{ !inputs.dry_run }}
77+
run: |
78+
git config user.name "github-actions[bot]"
79+
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
80+
git add CHANGELOG.md pyproject.toml
81+
git commit -m "Release $VERSION"
82+
git tag "v$VERSION"
83+
84+
- name: Push
85+
if: ${{ !inputs.dry_run }}
86+
run: |
87+
git push origin main
88+
git push origin "v$VERSION"
89+
90+
- name: Create GitHub release
91+
if: ${{ !inputs.dry_run }}
92+
env:
93+
GH_TOKEN: ${{ github.token }}
94+
run: |
95+
PREV_TAG=$(git tag --sort=-v:refname | sed -n '2p')
96+
if [ -n "$PREV_TAG" ]; then
97+
printf '\n**Full Changelog**: https://github.com/%s/compare/%s...v%s\n' \
98+
"${{ github.repository }}" "$PREV_TAG" "$VERSION" >> /tmp/release_body.md
99+
fi
100+
gh release create "v$VERSION" \
101+
--title "v$VERSION" \
102+
--notes-file /tmp/release_body.md
103+
104+
build_wheels:
105+
if: ${{ !inputs.dry_run }}
106+
needs: [ release ]
107+
name: Build wheels on ${{ matrix.os }}
108+
runs-on: ${{ matrix.os }}
109+
strategy:
110+
fail-fast: false
111+
matrix:
112+
os: [ ubuntu-latest, windows-latest, macos-14 ]
113+
permissions:
114+
contents: write
115+
steps:
116+
- name: Checkout Code
117+
uses: actions/checkout@v6
118+
with:
119+
ref: v${{ inputs.version }}
120+
121+
- name: Build wheels
122+
uses: pypa/cibuildwheel@v3.1.4
123+
env:
124+
CIBW_SKIP: "*-win32 *-manylinux_i686"
125+
126+
- name: Attach wheels to release
127+
env:
128+
GH_TOKEN: ${{ github.token }}
129+
run: gh release upload "v${{ inputs.version }}" wheelhouse/*.whl

CHANGELOG.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
# Changelog
2+
3+
All notable changes to this project will be documented in this file.
4+
5+
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
6+
7+
## [Unreleased]
8+
9+
## [0.1.0] - 2026-03-23
10+
11+
### Added
12+
- Initial release
13+
- Generate C++ headers from DWARF debug information
14+
- Support for Windows (MSVC), Linux (GCC), and macOS (Apple Clang)
15+
- pybind11 bindings for LLVM DWARF DebugInfo
16+
- Jinja2 template-based header generation

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# dwarf2cpp
22

3-
[![Build Status](https://github.com/endstone-insider/dwarf2cpp/actions/workflows/build.yml/badge.svg)](https://github.com/endstone-insider/dwarf2cpp/actions)
3+
[![Build Status](https://github.com/EndstoneMC/dwarf2cpp/actions/workflows/build.yml/badge.svg)](https://github.com/EndstoneMC/dwarf2cpp/actions)
44
![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)
55
![Python Version](https://img.shields.io/badge/python-3.10%2B-blue.svg)
66

@@ -21,7 +21,7 @@ Since dwarf2cpp uses **pybind11** to access LLVM's DWARF DebugInfo module from P
2121
* On macOS: **Apple Clang (Xcode Command Line Tools)**
2222

2323
```
24-
git clone https://github.com/endstone-insider/dwarf2cpp.git
24+
git clone https://github.com/EndstoneMC/dwarf2cpp.git
2525
cd dwarf2cpp
2626
pip install .
2727
```

0 commit comments

Comments
 (0)