Skip to content

Commit 33c565a

Browse files
committed
Publication to NPM.
1 parent b41de93 commit 33c565a

File tree

4 files changed

+63
-4
lines changed

4 files changed

+63
-4
lines changed

.github/workflows/publish-npm.yml

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
name: Publish to NPM
2+
3+
on:
4+
push:
5+
tags:
6+
# package-major.minor.patch - required
7+
# -beta.build - optional
8+
- '*-*.*.*'
9+
10+
jobs:
11+
build:
12+
runs-on: ubuntu-latest
13+
14+
steps:
15+
- id: get-package
16+
run: |
17+
PACKAGE_NAME=$(echo ${GITHUB_REF#refs/tags/} | cut -d- -f1)
18+
ALLOWED_PACKAGES=("phaser") # Add more package names if needed
19+
if [[ " ${ALLOWED_PACKAGES[@]} " =~ " ${PACKAGE_NAME} " ]]; then
20+
echo "::set-output name=package::${PACKAGE_NAME}"
21+
else
22+
echo "Invalid package name ${PACKAGE_NAME}."
23+
exit 1
24+
fi
25+
shell: bash
26+
27+
- uses: actions/checkout@v4
28+
29+
- name: Use Node.js
30+
uses: actions/setup-node@v4
31+
with:
32+
node-version: '20'
33+
registry-url: 'https://registry.npmjs.org'
34+
35+
- name: Check version
36+
run: |
37+
TAG_VERSION=$(echo ${GITHUB_REF#refs/tags/${{ steps.get-package.outputs.package }}-})
38+
PACKAGE_VERSION=$(node -p "require('./packages/${{ steps.get-package.outputs.package }}/package.json').version")
39+
if [[ "${TAG_VERSION}" != "${PACKAGE_VERSION}" ]]; then
40+
echo "Tag version ${TAG_VERSION} does not match package version ${PACKAGE_VERSION}."
41+
exit 1
42+
fi
43+
44+
- name: Install dependencies
45+
run: npm ci
46+
47+
- name: Build
48+
run: npm run build --workspace @barinbritva/${{ steps.get-package.outputs.package }}-sdk
49+
50+
- name: Publish
51+
run: cd packages/${{ steps.get-package.outputs.package }} && npm publish --access=public
52+
env:
53+
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
1-
# gamefi-sdk
1+
# game-engines-sdk
22

3-
TON bindings and utilities for game engines:
3+
TON blockchain bindings and utilities for game engines:
44
* Phaser.io
55
* Cocos2d (coming soon)
66

77
# Getting started
88
Installation:
99
```sh
10-
npm install --save @ton-community/gamefi-phaser
10+
npm install --save @barinbritva/phaser-sdk
1111
```
1212

1313
Creating GameFi instance:

package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
{
22
"name": "@barinbritva/game-engines-sdk",
3-
"private": true,
43
"engines": {
54
"node": ">=18.0.0",
65
"npm": ">=9.0.0"

packages/phaser/README.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# phaser-sdk
2+
3+
TON blockchain bindings and utilities for [Phaser.io](https://phaser.io/) game engine.
4+
5+
# Documentation
6+
7+
Please read the documentation in the official [repository](https://github.com/barinbritva/game-engines-sdk).

0 commit comments

Comments
 (0)