*Github Package ?
1. Unity package ๋ง๋ค๊ธฐ
package ๋ฅผ github registry ์ publish ํ๊ธฐ ์ํด์๋ registry ๋ฅผ ์ฐ๊ฒฐํด์ฃผ์ด์ผ ํ๋ค.
package ๋ฅผ registry ์ ์ฐ๊ฒฐํ๋ ๋ฒ์ ์ฌ๋ฌ ๊ฐ์ง๊ฐ ์๋ค.
๋๋ unity ํ๋ก์ ํธ ์ด๋ฏ๋ก Unity Package Manager ๋ฅผ ์ด์ฉํ ์ ์๋ package.json ํ์ผ์ ์ด์ฉํ๋ค.
package.json ํ์ผ ์์ publishConfig ํค์๋๋ฅผ ์ฌ์ฉํด์ package ๋ฅผ registry ๋ฅผ ์ฐ๊ฒฐํ๋ฉด ๋๋ค.
"publishConfig": {
"registry": "https://npm.pkg.github.com"
},
[package ๋ง๋ค ๋ ์ฃผ์์ฌํญ]
1) package ์ด๋ฆ(name)๊ณผ ๋ฒ์์๋ ์๋ฌธ์๋ง์ ์ฌ์ฉํด์ผ ํ๋ค.
2) npm ๋ฒ์ ์ tarball ํฌ๊ธฐ๋ 256MB ๋ณด๋ค ์์์ผ ํ๋ค.
์์ธ ๋ด์ฉ์ ํ๋จ ๊ฒ์๊ธ ์ฐธ๊ณ .
2. personal access token(classic) ์ธ์ฆํ์ผ ๋ง๋ค๊ธฐ
github token(classic) ์ ๋ฐ์์ .npmrc ํ์ผ์ ๋ง๋ ๋ค.
//npm.pkg.github.com/:_authToken=TOKEN
always-auth ์กฐ๊ฑด ์ถ๊ฐ๋ ๊ฐ๋ฅ!
3. npm Login
$ npm login --scope=@NAMESPACE --auth-type=legacy --registry=https://npm.pkg.github.com
username ๊ณผ password(personal access token(classic)) ์ ๋ ฅํ๋ฉด ๋ก๊ทธ์ธ ์ฑ๊ณต.
4. package publish
$ npm publish
npm publish ์ฑ๊ณต.
6. Github ์ Package ํญ์์ npm package ํ์ธ
'๐ฎ Unity Study > Unity' ์นดํ ๊ณ ๋ฆฌ์ ๋ค๋ฅธ ๊ธ
[Unity] Button onClick.AddListener (0) | 2024.02.16 |
---|---|
[Unity][MenuItem hotkey(shortkey)] %(ctrl, cmd), #(shift), &(alt)... (0) | 2024.01.24 |
Android API version ๋ณ SDK ๋ฒ์ (feat. Unity ๋ฒ์ ๋ณ NDK, JDK Version) (0) | 2023.11.29 |
[Unity] Custom Unity Package in Git ๋งน๋ค๊ธฐ (0) | 2023.09.22 |
[Unity] Url to Image (RawImage, UnityWebRequest, Couroutine, Action<Texture>) (0) | 2023.08.30 |