Skip to content

Commit d78b64e

Browse files
Nekoya-JinNekoya-Jin
authored andcommitted
Release v1.0.3: 의존성 및 자동화 개선
- UniTask 의존성 자동 설치 추가 - GitHub Actions로 버전 자동 업데이트 - 동적 버전 배지 적용 - 문서 개선
1 parent 78fe664 commit d78b64e

File tree

5 files changed

+145
-12
lines changed

5 files changed

+145
-12
lines changed
Lines changed: 103 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,103 @@
1+
name: Update Package Version
2+
3+
on:
4+
push:
5+
tags:
6+
- 'v*.*.*' # v1.0.0, v1.0.1 등의 태그가 푸시될 때 실행
7+
8+
jobs:
9+
update-version:
10+
runs-on: ubuntu-latest
11+
12+
steps:
13+
- name: Checkout repository
14+
uses: actions/checkout@v4
15+
with:
16+
fetch-depth: 0
17+
token: ${{ secrets.GITHUB_TOKEN }}
18+
19+
- name: Extract version from tag
20+
id: get_version
21+
run: |
22+
# 태그 이름에서 'v' 제거하여 버전 추출 (예: v1.0.2 -> 1.0.2)
23+
VERSION=${GITHUB_REF#refs/tags/v}
24+
echo "version=$VERSION" >> $GITHUB_OUTPUT
25+
echo "📦 Extracted version: $VERSION"
26+
27+
- name: Update package.json version
28+
run: |
29+
VERSION=${{ steps.get_version.outputs.version }}
30+
PACKAGE_FILE="src/UniFP/Assets/Plugins/UniFP/package.json"
31+
32+
# jq를 사용하여 package.json의 version 필드 업데이트
33+
jq --arg ver "$VERSION" '.version = $ver' "$PACKAGE_FILE" > tmp.json
34+
mv tmp.json "$PACKAGE_FILE"
35+
36+
echo "✅ Updated package.json to version $VERSION"
37+
cat "$PACKAGE_FILE"
38+
39+
- name: Check for changes
40+
id: check_changes
41+
run: |
42+
if git diff --quiet; then
43+
echo "changed=false" >> $GITHUB_OUTPUT
44+
echo "ℹ️ No changes detected"
45+
else
46+
echo "changed=true" >> $GITHUB_OUTPUT
47+
echo "📝 Changes detected"
48+
fi
49+
50+
- name: Commit and push changes
51+
if: steps.check_changes.outputs.changed == 'true'
52+
run: |
53+
VERSION=${{ steps.get_version.outputs.version }}
54+
55+
git config user.name "github-actions[bot]"
56+
git config user.email "github-actions[bot]@users.noreply.github.com"
57+
58+
git add src/UniFP/Assets/Plugins/UniFP/package.json
59+
git commit -m "chore: update package.json version to $VERSION [skip ci]"
60+
61+
# 태그가 생성된 커밋에 변경사항 추가 (force push)
62+
git push origin HEAD:main
63+
64+
echo "✅ Changes committed and pushed"
65+
66+
- name: Update tag to include version change
67+
if: steps.check_changes.outputs.changed == 'true'
68+
run: |
69+
VERSION=${{ steps.get_version.outputs.version }}
70+
TAG_NAME="v$VERSION"
71+
72+
# 기존 태그 삭제
73+
git tag -d "$TAG_NAME" || true
74+
git push origin ":refs/tags/$TAG_NAME" || true
75+
76+
# 새로운 태그 생성 (업데이트된 커밋에)
77+
git tag -a "$TAG_NAME" -m "Release $TAG_NAME"
78+
git push origin "$TAG_NAME"
79+
80+
echo "✅ Tag $TAG_NAME updated"
81+
82+
- name: Create Release
83+
if: steps.check_changes.outputs.changed == 'true'
84+
uses: softprops/action-gh-release@v1
85+
with:
86+
tag_name: v${{ steps.get_version.outputs.version }}
87+
name: Release v${{ steps.get_version.outputs.version }}
88+
body: |
89+
## UniFP v${{ steps.get_version.outputs.version }}
90+
91+
### 변경사항
92+
자세한 변경사항은 [커밋 히스토리](https://github.com/${{ github.repository }}/commits/v${{ steps.get_version.outputs.version }})를 확인해주세요.
93+
94+
### 설치 방법
95+
96+
Unity Package Manager에서 다음 URL을 사용하여 설치:
97+
```
98+
https://github.com/${{ github.repository }}.git?path=src/UniFP/Assets/Plugins/UniFP#v${{ steps.get_version.outputs.version }}
99+
```
100+
draft: false
101+
prerelease: false
102+
env:
103+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

README.ko.md

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
[![Unity](https://img.shields.io/badge/Unity-2020.3%2B-000?logo=unity)](https://unity.com/)
88
[![License: MIT](https://img.shields.io/badge/License-MIT-success.svg)](./LICENSE)
9-
[![Release](https://img.shields.io/badge/version-v1.0.0-blue)](https://github.com/Nekoya-Jin/UniFP/releases)
9+
[![Release](https://img.shields.io/github/v/release/Nekoya-Jin/UniFP?label=version&color=blue)](https://github.com/Nekoya-Jin/UniFP/releases)
1010

1111
UniFP는 Rust과 Haskell, F# 영감을 받아, Unity 게임 로직에 함수형 사고방식과 명시적 에러 처리를 도입하는 GC ZERO allocation C# 함수형 프로그래밍 프레임워크입니다.
1212

@@ -32,6 +32,7 @@ UniFP는 Rust과 Haskell, F# 영감을 받아, Unity 게임 로직에 함수형
3232
- [시작하기](#시작하기)
3333
- [UPM 설치 (권장)](#upm-설치-권장)
3434
- [수동 설치](#수동-설치)
35+
- [의존성](#의존성)
3536
- [핵심 개념](#핵심-개념)
3637
- [`Result<T>`**if/else와 try/catch 지옥**에서 해방 🔥🔥🔥](#resultt--ifelse와-trycatch-지옥에서-해방-)
3738
- [`Option<T>`**Null지옥**에서 해방 🔥🔥🔥](#optiont--null지옥에서-해방-)
@@ -89,6 +90,14 @@ UniFP는 Rust과 Haskell, F# 영감을 받아, Unity 게임 로직에 함수형
8990

9091
`src/UniFP/Assets/Plugins/UniFP` 디렉터리를 프로젝트의 `Assets/Plugins/UniFP` 아래로 복사합니다. `UniFP.asmdef`를 포함해야 Unity 빌드 타임이 빠르게 유지됩니다.
9192

93+
### 의존성
94+
95+
UniFP는 **UniTask**를 필요로 합니다. UPM 설치 시 자동으로 설치되지만, 수동 설치 시에는 별도로 설치해야 합니다:
96+
97+
```text
98+
https://github.com/Cysharp/UniTask.git?path=src/UniTask/Assets/Plugins/UniTask
99+
```
100+
92101
## 핵심 개념
93102

94103
### `Result<T>`**if/else와 try/catch 지옥**에서 해방 🔥🔥🔥

README.md

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
[![Unity](https://img.shields.io/badge/Unity-2020.3%2B-000?logo=unity)](https://unity.com/)
88
[![License: MIT](https://img.shields.io/badge/License-MIT-success.svg)](./LICENSE)
9-
[![Release](https://img.shields.io/badge/version-v1.0.0-blue)](https://github.com/Nekoya-Jin/UniFP/releases)
9+
[![Release](https://img.shields.io/github/v/release/Nekoya-Jin/UniFP?label=version&color=blue)](https://github.com/Nekoya-Jin/UniFP/releases)
1010

1111
UniFP is a GC zero-allocation C# functional programming framework for Unity, inspired by Rust, Haskell, and F#. It brings functional thinking and explicit error handling to game logic without hurting runtime performance.
1212

@@ -32,6 +32,7 @@ UniFP was developed as a lightweight alternative optimized for real-time applica
3232
- [Getting Started](#getting-started)
3333
- [UPM Installation (Recommended)](#upm-installation-recommended)
3434
- [Manual Installation](#manual-installation)
35+
- [Dependencies](#dependencies)
3536
- [Core Concepts](#core-concepts)
3637
- [`Result<T>` — Escape the if/else and try/catch Hell 🔥🔥🔥](#resultt--escape-the-ifelse-and-trycatch-hell-)
3738
- [`Option<T>` — Escape the Null Hell 🔥🔥🔥](#optiont--escape-the-null-hell-)
@@ -89,6 +90,14 @@ To modify `Packages/manifest.json` directly, add the following dependency:
8990

9091
Copy the `src/UniFP/Assets/Plugins/UniFP` directory to your project under `Assets/Plugins/UniFP`. Include `UniFP.asmdef` to keep Unity build times fast.
9192

93+
### Dependencies
94+
95+
UniFP requires **UniTask**. It will be installed automatically with UPM installation, but for manual installation, you need to install it separately:
96+
97+
```text
98+
https://github.com/Cysharp/UniTask.git?path=src/UniTask/Assets/Plugins/UniTask
99+
```
100+
92101
## Core Concepts
93102

94103
### `Result<T>` — Escape the if/else and try/catch Hell 🔥🔥🔥

README.zh-CN.md

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
[![Unity](https://img.shields.io/badge/Unity-2020.3%2B-000?logo=unity)](https://unity.com/)
88
[![License: MIT](https://img.shields.io/badge/License-MIT-success.svg)](./LICENSE)
9-
[![Release](https://img.shields.io/badge/version-v1.0.0-blue)](https://github.com/Nekoya-Jin/UniFP/releases)
9+
[![Release](https://img.shields.io/github/v/release/Nekoya-Jin/UniFP?label=version&color=blue)](https://github.com/Nekoya-Jin/UniFP/releases)
1010

1111
UniFP 是一款受 Rust、Haskell 与 F# 启发的 Unity 专用 C# 函数式编程框架,追求 GC 零分配,让函数式思维与显式错误处理安全落地在游戏逻辑中。
1212

@@ -31,6 +31,7 @@ UniFP 将 Rust 式的类型精度与函数式语言的“铁路编程”理念
3131
- [开始使用](#开始使用)
3232
- [通过 UPM 安装(推荐)](#通过-upm-安装推荐)
3333
- [手动安装](#手动安装)
34+
- [依赖项](#依赖项)
3435
- [核心概念](#核心概念)
3536
- [`Result<T>` —— 逃离 if/else 与 try/catch 迷宫 🔥🔥🔥](#resultt--逃离-ifelse-与-trycatch-迷宫-)
3637
- [`Option<T>` —— 不再被 null 检查淹没 👻](#optiont--不再被-null-检查淹没-)
@@ -88,6 +89,14 @@ UniFP 将 Rust 式的类型精度与函数式语言的“铁路编程”理念
8889

8990
`src/UniFP/Assets/Plugins/UniFP` 拷贝到项目的 `Assets/Plugins/UniFP`。请保留 `UniFP.asmdef`,以确保 Unity 编译速度。
9091

92+
### 依赖项
93+
94+
UniFP 需要 **UniTask**。通过 UPM 安装时会自动安装,但手动安装时需要单独安装:
95+
96+
```text
97+
https://github.com/Cysharp/UniTask.git?path=src/UniTask/Assets/Plugins/UniTask
98+
```
99+
91100
## 核心概念
92101

93102
### `Result<T>` —— 逃离 if/else 与 try/catch 迷宫 🔥🔥🔥
Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
{
2-
"name": "com.yourcompany.unifp",
3-
"version": "1.0.0",
2+
"name": "com.nekoya.unifp",
3+
"version": "1.0.2",
44
"displayName": "UniFP",
5-
"description": "Functional programming library for Unity - safe error handling with the Result monad and pipeline pattern",
5+
"description": "Functional programming library for Unity",
66
"unity": "2020.3",
7-
"documentationUrl": "https://github.com/YOUR_USERNAME/UniFP",
8-
"changelogUrl": "https://github.com/YOUR_USERNAME/UniFP/blob/master/CHANGELOG.md",
9-
"licensesUrl": "https://github.com/YOUR_USERNAME/UniFP/blob/master/LICENSE",
7+
"documentationUrl": "https://github.com/Nekoya-Jin/UniFP",
8+
"changelogUrl": "https://github.com/Nekoya-Jin/UniFP/blob/master/CHANGELOG.md",
9+
"licensesUrl": "https://github.com/Nekoya-Jin/UniFP/blob/master/LICENSE",
1010
"keywords": [
1111
"functional",
1212
"monad",
@@ -16,8 +16,11 @@
1616
"fp"
1717
],
1818
"author": {
19-
"name": "Your Name",
20-
"email": "[email protected]",
21-
"url": "https://github.com/YOUR_USERNAME"
19+
"name": "Nekoya",
20+
"email": "[email protected]",
21+
"url": "https://github.com/Nekoya-Jin"
22+
},
23+
"dependencies": {
24+
"com.cysharp.unitask": "https://github.com/Cysharp/UniTask.git?path=src/UniTask/Assets/Plugins/UniTask"
2225
}
2326
}

0 commit comments

Comments
 (0)