diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 324fd7a..79eccd6 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -43,13 +43,13 @@ jobs: with: fetch-depth: 0 - - name: Ensure release runs from main + - name: Ensure release runs from development shell: bash run: | set -euo pipefail - if [[ "${GITHUB_REF}" != "refs/heads/main" ]]; then - echo "Run this workflow from main." >&2 + if [[ "${GITHUB_REF}" != "refs/heads/development" ]]; then + echo "Run this workflow from development." >&2 exit 1 fi @@ -86,20 +86,16 @@ jobs: exit 1 fi - printf '%s\n' "${next_version}" > VERSION - echo "current=${current_version}" >> "$GITHUB_OUTPUT" echo "next=${next_version}" >> "$GITHUB_OUTPUT" echo "branch=${release_branch}" >> "$GITHUB_OUTPUT" - name: Inspect release refs - id: refs shell: bash run: | set -euo pipefail version="${{ steps.version.outputs.next }}" - branch="${{ steps.version.outputs.branch }}" if git ls-remote --exit-code --tags origin "refs/tags/${version}" >/dev/null 2>&1; then echo "Tag ${version} already exists." >&2 @@ -111,11 +107,21 @@ jobs: exit 1 fi - if git ls-remote --exit-code --heads origin "${branch}" >/dev/null 2>&1; then - echo "branch_exists=true" >> "$GITHUB_OUTPUT" - else - echo "branch_exists=false" >> "$GITHUB_OUTPUT" - fi + - name: Create release branch + shell: bash + run: | + set -euo pipefail + + branch="${{ steps.version.outputs.branch }}" + + # Always (re)create from development so the release includes all + # new changes — even on a rerun where the branch already exists. + git fetch origin development + git switch -c "${branch}" origin/development + + # Merge main to incorporate any commits not on development + # (e.g. previous release chore commits) + git merge origin/main --no-edit - name: Validate build shell: bash @@ -138,7 +144,9 @@ jobs: fi today="$(date -u +%Y-%m-%d)" - # Collect conventional commits since the previous tag + # Collect conventional commits since the previous tag. + # --first-parent follows only the mainline (one entry per merged PR, + # no duplicates from feature branch commits). features="" fixes="" while IFS= read -r line; do @@ -154,7 +162,7 @@ jobs: rest="${msg#fix(}" fixes="${fixes}- ${rest#*): }"$'\n' fi - done < <(git log "${prev_tag}..HEAD" --oneline --no-merges 2>/dev/null || git log --oneline --no-merges) + done < <(git log "${prev_tag}..HEAD" --oneline --first-parent 2>/dev/null || git log --oneline --first-parent) # Build the new changelog section new_section="## [${version}] - ${today}"$'\n' @@ -174,34 +182,18 @@ jobs: } > "${tmp}" mv "${tmp}" CHANGELOG.md - - name: Create or reuse release branch + - name: Commit and push release changes shell: bash run: | set -euo pipefail version="${{ steps.version.outputs.next }}" branch="${{ steps.version.outputs.branch }}" - branch_exists="${{ steps.refs.outputs.branch_exists }}" - - if [[ "${branch_exists}" == "true" ]]; then - git restore --source=HEAD --staged --worktree VERSION CHANGELOG.md - git fetch origin "${branch}" - git switch -C "${branch}" "origin/${branch}" - - branch_version="$(tr -d '[:space:]' < VERSION)" - if [[ "${branch_version}" != "${version}" ]]; then - echo "Existing ${branch} has VERSION ${branch_version}, expected ${version}." >&2 - exit 1 - fi - - exit 0 - fi - git switch -c "${branch}" printf '%s\n' "${version}" > VERSION git add VERSION CHANGELOG.md git commit -m "chore(release): ${version}" -m "- bump VERSION to ${version}" -m "- update CHANGELOG.md" - git push --set-upstream origin "${branch}" + git push --force-with-lease --set-upstream origin "${branch}" - name: Open or reuse release pull request id: pr diff --git a/CHANGELOG.md b/CHANGELOG.md index 81c384d..f1f6e38 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,24 @@ 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). + +## [0.1.2] - 2026-05-21 + +### Features + +- add two darker brightness steps to rain palette (#71) +- group options sheet into sections (#69) + +### Bug Fixes + +- restrict release workflow dispatch to development branch (#83) +- always regenerate changelog on release reruns (#82) +- allow release workflow dispatch from development branch (#81) +- source release changelog from development branch (#80) +- derive current version from latest git tag in release workflow (#74) +- auto-merge back-merge PR and sync VERSION after release (#73) +- apply typing speed to all intro scenes (#70) + ## [0.1.1] - 2026-05-20 ### Features diff --git a/VERSION b/VERSION index 17e51c3..d917d3e 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -0.1.1 +0.1.2