diff --git a/.github/workflows/upm-split.yml b/.github/workflows/upm-split.yml new file mode 100644 index 0000000..3cda60a --- /dev/null +++ b/.github/workflows/upm-split.yml @@ -0,0 +1,22 @@ +name: Publish UPM +on: + push: + branches: [main] + paths: ['Packages/com.darkmattergameproduction.fonepay-unity/**'] + workflow_dispatch: + +jobs: + split: + runs-on: ubuntu-latest + permissions: + contents: write + steps: + - uses: actions/checkout@v4 + with: + fetch-depth: 0 + - name: Split subtree to upm branch + run: | + git config user.name "github-actions[bot]" + git config user.email "41898282+github-actions[bot]@users.noreply.github.com" + git subtree split --prefix=Packages/com.darkmattergameproduction.fonepay-unity -b upm + git push origin upm --force diff --git a/README.md b/README.md index 2685f2b..01ad30b 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,7 @@ Fonepay payment SDK for Unity. Generate Fonepay QR codes, await payment confirmation over websocket, and process tax refunds — all from a single async-friendly client. -This repo is a **Unity 6000.4.5f1** project that hosts the package source under `Packages/com.darkmattergameproduction.com.darkmatter.fonepay-unity/` and a sample scene under `Assets/`. +This repo is a **Unity 6000.4.5f1** project that hosts the package source under `Packages/com.darkmattergameproduction.fonepay-unity/` and a sample scene under `Assets/`. --- @@ -30,20 +30,28 @@ This repo is a **Unity 6000.4.5f1** project that hosts the package source under ## Install -### As a local package (this repo) +### Via Unity Package Manager (recommended) + +**Window > Package Manager > + > Install package from git URL** + +``` +https://github.com/Savya-lol/Fonepay-Unity.git#0.1.0 +``` + +Or edit `Packages/manifest.json` directly: +```json +"com.darkmattergameproduction.fonepay-unity": "https://github.com/Savya-lol/Fonepay-Unity.git#0.1.0" +``` + +Pin to any released tag (e.g. `#0.1.0`) or track the floating `upm` branch (`#upm`). The `upm` branch is the package subtree, auto-published from `main` via GitHub Actions. + +### As a local clone of this repo 1. Clone: ```bash - git clone "Fonepay Unity" + git clone https://github.com/Savya-lol/Fonepay-Unity.git "Fonepay Unity" ``` -2. Open the project in Unity Hub (6000.4.5f1). - -### As a Git package in another project - -Add to your target project's `Packages/manifest.json`: -```json -"com.darkmattergameproduction.com.darkmatter.fonepay-unity": "https://github.com//.git?path=/Packages/com.darkmattergameproduction.com.darkmatter.fonepay-unity" -``` +2. Open in Unity Hub (6000.4.5f1). ### Setup credentials @@ -164,7 +172,7 @@ TaxRefundResponse refund = await fonepay.PostTaxRefundAsync(new TaxRefundRequest ``` Assets/ Sample scene + test MonoBehaviour Packages/ - com.darkmattergameproduction.com.darkmatter.fonepay-unity/ + com.darkmattergameproduction.fonepay-unity/ Runtime/ Core/ FonepayClient, FonepayConfig, FonepayConfigSO API/ FonepayApiClient (REST), FonepayWebsocketClient @@ -228,4 +236,4 @@ CLI (Unity 6 batchmode): ## License -See `Packages/com.darkmattergameproduction.com.darkmatter.fonepay-unity/Third Party Notices.md` for third-party attributions (QRCoder, UniTask). Project license: TBD. +See `Packages/com.darkmattergameproduction.fonepay-unity/Third Party Notices.md` for third-party attributions (QRCoder, UniTask). Project license: TBD.