mirror of
https://github.com/sebastiandine/Card-Collection-Manager-3.git
synced 2026-08-28 23:01:09 +00:00
major: initial release
* initial development * pipeline * pipeline * pipeline * pipeline * pipeline * pipeline * pipeline * pipeline * pipeline * pipeline * pipeline * pipeline * pipeline * pipeline * ci/cd * ci/cd * ci/cd * ci/cd * ci/cd * ci/cd * ci/cd * pokemon * pokemon * pokemon * pokemon * pokemon * pokemon * improvements * improvements * ci/cd * ci/cd * improvements * improvements * improvements * improvements * improvements * improvements * improvements * improvements * improvements --------- Co-authored-by: sdine <sdine@sdine.com>
This commit is contained in:
@@ -0,0 +1,28 @@
|
||||
# AGENTS.md
|
||||
|
||||
Utility scripts and CI helper assets live in this folder.
|
||||
|
||||
## Scope
|
||||
|
||||
- Keep CI-facing scripts and config here so workflows stay concise.
|
||||
- Current contents:
|
||||
- `installer.nsi` — NSIS installer definition used by the Windows CI job.
|
||||
- `installer_icon.ico` — committed installer icon consumed by `installer.nsi`.
|
||||
- `compute_feature_version.sh` — branch+sha version formatter for feature CI workflows.
|
||||
- `compute_master_semver.sh` — semantic version bump logic for merged PRs to `master`.
|
||||
|
||||
## Editing rules
|
||||
|
||||
- Prefer referencing script files from workflows instead of embedding large inline scripts.
|
||||
- Keep scripts deterministic and non-interactive so CI can run unattended.
|
||||
- Keep versioning scripts strict and fail-fast (non-zero exit) when required title/version conventions are violated.
|
||||
- When changing installer behavior, edit `installer.nsi` and ensure both `.github/workflows/feature-windows.yml` and `.github/workflows/master-windows.yml` still invoke it via `makensis -DAPP_VERSION="${VERSION}" scripts/installer.nsi`.
|
||||
- Keep installer assets that should not be generated at runtime (such as icon files) committed in this folder.
|
||||
- `installer.nsi` path semantics:
|
||||
- `installer_icon.ico` is resolved relative to `scripts/`.
|
||||
- build payload is loaded from `..\build\bin\*.*` (project root build output).
|
||||
- installer output is written to `..\ccm3-windows-installer.exe` so CI upload paths can stay root-based.
|
||||
- `installer.nsi` version semantics:
|
||||
- `APP_VERSION` is supplied by CI (`makensis -DAPP_VERSION=...`) using the same `VERSION` value that is fed into `-DCCM_APP_VERSION` for the C++ build, so the installer, uninstaller, Add/Remove Programs entry, and the running app all advertise the same version.
|
||||
- When `APP_VERSION` is not provided (manual local `makensis` runs), it defaults to `"localbuild"`.
|
||||
- If a script depends on generated files, document those expectations in the script or workflow step that creates them.
|
||||
@@ -0,0 +1,19 @@
|
||||
#!/usr/bin/env bash
|
||||
set -euo pipefail
|
||||
|
||||
if [[ $# -lt 2 ]]; then
|
||||
echo "Usage: $0 <branch-name> <commit-sha>" >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
branch_name="$1"
|
||||
commit_sha="$2"
|
||||
|
||||
branch_safe="$(echo "${branch_name}" | tr '[:upper:]' '[:lower:]' | sed -E 's/[^a-z0-9._-]+/-/g; s/^-+|-+$//g')"
|
||||
short_sha="$(echo "${commit_sha}" | cut -c1-7)"
|
||||
|
||||
if [[ -z "${branch_safe}" ]]; then
|
||||
branch_safe="branch"
|
||||
fi
|
||||
|
||||
echo "${branch_safe}-${short_sha}"
|
||||
@@ -0,0 +1,54 @@
|
||||
#!/usr/bin/env bash
|
||||
set -euo pipefail
|
||||
|
||||
if [[ $# -lt 1 ]]; then
|
||||
echo "Usage: $0 <pr-title>" >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
pr_title="$(echo "$1" | tr '[:upper:]' '[:lower:]')"
|
||||
|
||||
if [[ "${pr_title}" == major* ]]; then
|
||||
bump="major"
|
||||
elif [[ "${pr_title}" == minor* ]]; then
|
||||
bump="minor"
|
||||
elif [[ "${pr_title}" == fix* || "${pr_title}" == patch* || "${pr_title}" == path* ]]; then
|
||||
bump="patch"
|
||||
else
|
||||
echo "Invalid PR title prefix. Must start with: major, minor, fix, patch, or path." >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
latest="$(git tag --list | sed -E 's/^v//' | grep -E '^[0-9]+\.[0-9]+\.[0-9]+$' | sort -t. -k1,1nr -k2,2nr -k3,3nr | head -n1 || true)"
|
||||
if [[ -z "${latest}" ]]; then
|
||||
latest="0.0.0"
|
||||
fi
|
||||
|
||||
IFS='.' read -r major minor patch <<< "${latest}"
|
||||
|
||||
case "${bump}" in
|
||||
major)
|
||||
major=$((major + 1))
|
||||
minor=0
|
||||
patch=0
|
||||
;;
|
||||
minor)
|
||||
minor=$((minor + 1))
|
||||
patch=0
|
||||
;;
|
||||
patch)
|
||||
patch=$((patch + 1))
|
||||
;;
|
||||
esac
|
||||
|
||||
version="${major}.${minor}.${patch}"
|
||||
release_tag="v${version}"
|
||||
|
||||
if [[ -n "${GITHUB_OUTPUT:-}" ]]; then
|
||||
{
|
||||
echo "version=${version}"
|
||||
echo "release_tag=${release_tag}"
|
||||
} >> "${GITHUB_OUTPUT}"
|
||||
else
|
||||
echo "${version}"
|
||||
fi
|
||||
@@ -0,0 +1,76 @@
|
||||
Unicode True
|
||||
!include "MUI2.nsh"
|
||||
|
||||
!define APP_NAME "Card Collection Manager 3"
|
||||
!define APP_DIR "Card Collection Manager 3"
|
||||
!define APP_EXE "ccm3.exe"
|
||||
!define APP_ICON "installer_icon.ico"
|
||||
!define REG_KEY "Software\Microsoft\Windows\CurrentVersion\Uninstall\Card Collection Manager 3"
|
||||
!define APP_PATHS_KEY "Software\Microsoft\Windows\CurrentVersion\App Paths\ccm3.exe"
|
||||
|
||||
; APP_VERSION is supplied by CI via `makensis -DAPP_VERSION=...`. Falls back to
|
||||
; "localbuild" so manual runs from a developer machine still work.
|
||||
!ifndef APP_VERSION
|
||||
!define APP_VERSION "localbuild"
|
||||
!endif
|
||||
|
||||
Name "${APP_NAME} ${APP_VERSION}"
|
||||
OutFile "..\ccm3-windows-installer.exe"
|
||||
Icon "${APP_ICON}"
|
||||
UninstallIcon "${APP_ICON}"
|
||||
BrandingText "${APP_NAME} ${APP_VERSION}"
|
||||
InstallDir "$PROGRAMFILES64\${APP_DIR}"
|
||||
RequestExecutionLevel admin
|
||||
|
||||
!insertmacro MUI_PAGE_WELCOME
|
||||
!insertmacro MUI_PAGE_DIRECTORY
|
||||
!insertmacro MUI_PAGE_COMPONENTS
|
||||
!insertmacro MUI_PAGE_INSTFILES
|
||||
!insertmacro MUI_PAGE_FINISH
|
||||
|
||||
!insertmacro MUI_UNPAGE_CONFIRM
|
||||
!insertmacro MUI_UNPAGE_INSTFILES
|
||||
!insertmacro MUI_LANGUAGE "English"
|
||||
|
||||
Section "!Core files (required)"
|
||||
SectionIn RO
|
||||
SetOutPath "$INSTDIR"
|
||||
File /r "..\build\bin\*.*"
|
||||
WriteUninstaller "$INSTDIR\Uninstall.exe"
|
||||
WriteRegStr HKLM "${REG_KEY}" "DisplayName" "${APP_NAME}"
|
||||
WriteRegStr HKLM "${REG_KEY}" "DisplayVersion" "${APP_VERSION}"
|
||||
WriteRegStr HKLM "${REG_KEY}" "DisplayIcon" "$INSTDIR\${APP_EXE}"
|
||||
WriteRegStr HKLM "${REG_KEY}" "UninstallString" "$\"$INSTDIR\Uninstall.exe$\""
|
||||
WriteRegStr HKLM "${REG_KEY}" "QuietUninstallString" "$\"$INSTDIR\Uninstall.exe$\" /S"
|
||||
WriteRegStr HKLM "${REG_KEY}" "InstallLocation" "$INSTDIR"
|
||||
WriteRegDWORD HKLM "${REG_KEY}" "NoModify" 1
|
||||
WriteRegDWORD HKLM "${REG_KEY}" "NoRepair" 1
|
||||
WriteRegStr HKLM "${APP_PATHS_KEY}" "" "$INSTDIR\${APP_EXE}"
|
||||
WriteRegStr HKLM "${APP_PATHS_KEY}" "Path" "$INSTDIR"
|
||||
SectionEnd
|
||||
|
||||
Section "Start Menu shortcuts"
|
||||
SetShellVarContext all
|
||||
CreateDirectory "$SMPROGRAMS\${APP_DIR}"
|
||||
CreateShortcut "$SMPROGRAMS\${APP_NAME}.lnk" "$INSTDIR\${APP_EXE}" "" "$INSTDIR\${APP_EXE}" 0
|
||||
CreateShortcut "$SMPROGRAMS\${APP_DIR}\${APP_NAME}.lnk" "$INSTDIR\${APP_EXE}" "" "$INSTDIR\${APP_EXE}" 0
|
||||
CreateShortcut "$SMPROGRAMS\${APP_DIR}\Uninstall ${APP_NAME}.lnk" "$INSTDIR\Uninstall.exe"
|
||||
SectionEnd
|
||||
|
||||
Section "Desktop shortcut"
|
||||
SetShellVarContext all
|
||||
CreateShortcut "$DESKTOP\${APP_NAME}.lnk" "$INSTDIR\${APP_EXE}" "" "$INSTDIR\${APP_EXE}" 0
|
||||
SectionEnd
|
||||
|
||||
Section "Uninstall"
|
||||
SetShellVarContext all
|
||||
Delete "$DESKTOP\${APP_NAME}.lnk"
|
||||
Delete "$SMPROGRAMS\${APP_NAME}.lnk"
|
||||
Delete "$SMPROGRAMS\${APP_DIR}\${APP_NAME}.lnk"
|
||||
Delete "$SMPROGRAMS\${APP_DIR}\Uninstall ${APP_NAME}.lnk"
|
||||
RMDir "$SMPROGRAMS\${APP_DIR}"
|
||||
|
||||
RMDir /r "$INSTDIR"
|
||||
DeleteRegKey HKLM "${REG_KEY}"
|
||||
DeleteRegKey HKLM "${APP_PATHS_KEY}"
|
||||
SectionEnd
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 66 KiB |
Reference in New Issue
Block a user