forked from AmyrAhmady/samp-node
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
25 changed files
with
166 additions
and
430 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,49 +1,65 @@ | ||
name: Build CI | ||
|
||
on: [push, pull_request] | ||
on: | ||
workflow_dispatch: | ||
push: | ||
tags: | ||
- "*.*.*" | ||
pull_request: | ||
branches: | ||
- main | ||
release: | ||
types: | ||
- created | ||
|
||
jobs: | ||
linux: | ||
runs-on: ubuntu-22.04 | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
with: | ||
submodules: 'true' | ||
- name: install packages | ||
run: sudo apt-get install g++-multilib cmake | ||
- name: cmake | ||
run: mkdir build && cd build && cmake .. | ||
- name: make | ||
run: cd build && make -j4 | ||
- name: cpack | ||
run: cd build && cpack | ||
- name: create releases directory | ||
run: mkdir releases | ||
- name: move release package | ||
run: cd build && mv cpack/*.tar.gz ../releases/samp-node-linux.tar.gz | ||
- uses: actions/upload-artifact@v1 | ||
with: | ||
name: linux-build-artifact.tar.gz | ||
path: releases/samp-node-linux.tar.gz | ||
|
||
- uses: actions/checkout@v4 | ||
with: | ||
submodules: "true" | ||
- name: install packages | ||
run: sudo apt-get install g++-multilib cmake | ||
- name: cmake | ||
run: mkdir build && cd build && cmake .. | ||
- name: make | ||
run: cd build && make -j4 | ||
- name: cpack | ||
run: cd build && cpack | ||
- name: create releases directory | ||
run: mkdir releases | ||
- name: move release package | ||
run: cd build && mv cpack/*.tar.gz ../releases/samp-node-linux.tar.gz | ||
- name: Upload to release | ||
uses: softprops/action-gh-release@v2 | ||
if: startsWith(github.ref, 'refs/tags/') | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
with: | ||
files: releases/samp-node-linux.tar.gz | ||
|
||
windows: | ||
runs-on: windows-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
with: | ||
submodules: 'true' | ||
- name: cmake | ||
run: mkdir build && cd build && cmake .. -A Win32 | ||
- name: build | ||
run: cd build && cmake --build . --config Release | ||
- name: cpack | ||
shell: powershell | ||
run: $env:PATH="C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\Common7\IDE\CommonExtensions\Microsoft\CMake\CMake\bin\;$env:PATH"; cd build; cpack | ||
- name: create releases directory | ||
run: mkdir releases | ||
- name: move release package | ||
run: cd build && mv cpack/*.zip ../releases/samp-node-windows.zip | ||
- uses: actions/upload-artifact@v1 | ||
with: | ||
name: windows-build-artifact.zip | ||
path: releases/samp-node-windows.zip | ||
- uses: actions/checkout@v4 | ||
with: | ||
submodules: "true" | ||
- name: cmake | ||
run: mkdir build && cd build && cmake .. -A Win32 | ||
- name: build | ||
run: cd build && cmake --build . --config Release | ||
- name: cpack | ||
shell: powershell | ||
run: $env:PATH="C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\Common7\IDE\CommonExtensions\Microsoft\CMake\CMake\bin\;$env:PATH"; cd build; cpack | ||
- name: create releases directory | ||
run: mkdir releases | ||
- name: move release package | ||
run: cd build && mv cpack/*.zip ../releases/samp-node-windows.zip | ||
- name: Upload to release | ||
uses: softprops/action-gh-release@v2 | ||
if: startsWith(github.ref, 'refs/tags/') | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
with: | ||
files: releases/samp-node-windows.zip |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,8 +6,5 @@ build/ | |
.vs/ | ||
Release/*.* | ||
Debug/*.* | ||
test/* | ||
dependencies/ | ||
releases/ | ||
|
||
!test/samp.json | ||
releases/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,38 +1,12 @@ | ||
# samp-node | ||
samp-node is a SA-MP plugin that allows you to run Node.js, meaning you can code in JS/TS instead of pawn. | ||
|
||
--------- | ||
Forked from [`samp-node`](https://github.com/AmyrAhmady/samp-node) | ||
|
||
Todo: | ||
- [ ] Add samp constant values (eg: INVALID_PLAYER_ID, MAX_TEXT_DRAWS, and etc...) | ||
###### Changes in this fork | ||
|
||
|
||
## Download | ||
You can always find latest builds [here](https://github.com/AmyrAhmady/samp-node/actions?query=workflow%3A%22Build+CI%22)\ | ||
But if you are looking for a stable version (or using sampctl), please visit [here](https://github.com/AmyrAhmady/samp-node/wiki/Installation) | ||
|
||
|
||
## Node version | ||
Currently samp-node uses Node.js v16. | ||
|
||
|
||
## Tips | ||
You should transpile your JS into commonjs to avoid issues. \ | ||
It's recommended you use TypeScript and setup a tsconfig that extends [@tsconfig/node16](https://www.npmjs.com/package/@tsconfig/node16). | ||
|
||
|
||
## Type definitions for TypeScript | ||
If you're using TypeScript then take a look at this repoistory: https://github.com/samp-dev/node \ | ||
Instructions can be found there on how to install and use them. \ | ||
*Special thanks to [pkfln (peek)](https://github.com/pkfln).* | ||
|
||
|
||
## Credits | ||
- [Damo](https://github.com/damopewpew) for his [samp.js project](https://github.com/damopewpew/samp.js). 80% of native caller code is from that project, cause I didn't want to do all the args processing by myself when there's already something useful out there! | ||
- [Hual](https://github.com/Hual/) for some v8 tips he gave me | ||
- [Graber](https://github.com/AGraber) for a few suggestions and helpful advices | ||
- [pkfln (peek)](https://github.com/pkfln) for fixing and adding some samp callbacks/events in samp-node, and making [@sa-mp/node](https://github.com/samp-dev/node) | ||
- [polygxn](https://github.com/polygxn) for his changes in README.md which don't exist anymore | ||
- [JustMichael (ADRFranklin)](https://github.com/ADRFranklin) for his contributions, including fixes, features, and any others he's going to do in future | ||
- [Alexander Plutalov (plutalov)](https://github.com/plutalov) for fixing long time crash issues and not having context running properly | ||
- [iAmir (Amyr Aahmady)](https://github.com/AmyrAhmady) that's me. | ||
- Used to work with [infernus](https://github.com/dockfries/infernus). | ||
- Update node.js to v16.20.2. | ||
- Only `entry_file` is used, `resource` config are removed. | ||
- Updated workflows. | ||
- Building based on `ubuntu-latest` means you may need a higher version of glibc. | ||
- Removed `samp.fire` to avoid crashes. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
PLUGIN_VERSION: 0.1.0 | ||
PLUGIN_VERSION: 2.3.1 |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.