mirror of
https://github.com/h3pdesign/Neon-Vision-Editor
synced 2026-04-21 13:27:16 +00:00
ci: add release workflow
This commit is contained in:
parent
ca0cb0467b
commit
d80b3645c7
2 changed files with 83 additions and 0 deletions
58
.github/workflows/release.yml
vendored
Normal file
58
.github/workflows/release.yml
vendored
Normal file
|
|
@ -0,0 +1,58 @@
|
|||
name: Release macOS app
|
||||
|
||||
on:
|
||||
push:
|
||||
tags:
|
||||
- "v*"
|
||||
|
||||
permissions:
|
||||
contents: write
|
||||
|
||||
jobs:
|
||||
release:
|
||||
runs-on: macos-latest
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Show Xcode Version
|
||||
run: xcodebuild -version
|
||||
|
||||
- name: Build macOS archive
|
||||
env:
|
||||
ARCHIVE_PATH: ${{ runner.temp }}/NeonVisionEditor.xcarchive
|
||||
run: |
|
||||
xcodebuild \
|
||||
-project "Neon Vision Editor.xcodeproj" \
|
||||
-scheme "Neon Vision Editor" \
|
||||
-configuration Release \
|
||||
-destination "generic/platform=macOS" \
|
||||
-archivePath "$ARCHIVE_PATH" \
|
||||
archive
|
||||
|
||||
- name: Zip app
|
||||
env:
|
||||
ARCHIVE_PATH: ${{ runner.temp }}/NeonVisionEditor.xcarchive
|
||||
run: |
|
||||
APP_PATH="$ARCHIVE_PATH/Products/Applications/Neon Vision Editor.app"
|
||||
if [[ ! -d "$APP_PATH" ]]; then
|
||||
echo "App not found at $APP_PATH" >&2
|
||||
exit 1
|
||||
fi
|
||||
ditto -c -k --sequesterRsrc --keepParent "$APP_PATH" "Neon.Vision.Editor.app.zip"
|
||||
|
||||
- name: Extract changelog section
|
||||
env:
|
||||
TAG_NAME: ${{ github.ref_name }}
|
||||
run: |
|
||||
./scripts/extract_changelog_section.sh CHANGELOG.md "$TAG_NAME" > release-notes.md
|
||||
|
||||
- name: Create GitHub Release
|
||||
env:
|
||||
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
TAG_NAME: ${{ github.ref_name }}
|
||||
run: |
|
||||
gh release create "$TAG_NAME" \
|
||||
--title "Neon Vision Editor $TAG_NAME" \
|
||||
--notes-file release-notes.md \
|
||||
"Neon.Vision.Editor.app.zip"
|
||||
25
scripts/extract_changelog_section.sh
Executable file
25
scripts/extract_changelog_section.sh
Executable file
|
|
@ -0,0 +1,25 @@
|
|||
#!/usr/bin/env bash
|
||||
set -euo pipefail
|
||||
|
||||
CHANGELOG_FILE="${1:-CHANGELOG.md}"
|
||||
VERSION_TAG="${2:-}"
|
||||
|
||||
if [[ -z "${VERSION_TAG}" ]]; then
|
||||
echo "Usage: $0 <changelog-file> <version-tag>" >&2
|
||||
exit 2
|
||||
fi
|
||||
|
||||
if [[ ! -f "${CHANGELOG_FILE}" ]]; then
|
||||
echo "Changelog not found: ${CHANGELOG_FILE}" >&2
|
||||
exit 2
|
||||
fi
|
||||
|
||||
awk -v version="${VERSION_TAG}" '
|
||||
BEGIN { in_section=0; found=0 }
|
||||
$0 ~ "^## \\[[^]]+\\]" {
|
||||
if (in_section) { exit }
|
||||
if ($0 ~ "^## \\[" version "\\]") { in_section=1; found=1 }
|
||||
}
|
||||
{ if (in_section) print }
|
||||
END { if (!found) exit 1 }
|
||||
' "${CHANGELOG_FILE}"
|
||||
Loading…
Reference in a new issue