Skip to content

Commit

Permalink
Set up GitHub Actions to publish to npm/crates.io (#119)
Browse files Browse the repository at this point in the history
* Set up GitHub Actions to publish to npm/crates.io

* Update publish-js.yml

---------

Co-authored-by: Jordan Peck <[email protected]>
  • Loading branch information
Keavon and Auburn authored Oct 6, 2023
1 parent 8facc71 commit e1a694d
Show file tree
Hide file tree
Showing 5 changed files with 63 additions and 8 deletions.
28 changes: 28 additions & 0 deletions .github/workflows/publish-js.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
on:
push:
branches:
- master
paths:
- 'JavaScript/package.json' # The version number must be bumped in order to publish to npm
workflow_dispatch:

name: Publish to npm

jobs:
publish:
name: Publish
runs-on: ubuntu-latest
steps:
- name: Checkout sources
uses: actions/checkout@v4

- name: Set up Node.js
uses: actions/setup-node@v3
with:
node-version: '20.x'
registry-url: 'https://registry.npmjs.org'

- name: Publish to npm
run: cd JavaScript && npm publish
env:
NODE_AUTH_TOKEN: ${{ secrets.NODE_AUTH_TOKEN }}
28 changes: 28 additions & 0 deletions .github/workflows/publish-rust.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
on:
push:
branches:
- master
paths:
- 'Rust/Cargo.toml' # The version number must be bumped in order to publish to crates.io

name: Publish Rust (crates.io)

jobs:
publish:
name: Publish to crates.io
runs-on: ubuntu-latest
steps:
- name: Checkout repo
uses: actions/checkout@v4

- name: Install Rust toolchain
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
override: true

- name: Publish to crates.io
run: cd Rust && cargo publish
env:
CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }}
4 changes: 2 additions & 2 deletions JavaScript/FastNoiseLite.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,8 @@
// https://www.npmjs.com/package/fastnoise-lite
// https://discord.gg/SHVaVfV
//
// Ported to JavaScript by storm (Patrick U):
// Discord: storm#8888 (preferred) | Email: [email protected] | GitHub: stormy482 (https://github.com/stormy482)
// Ported to JavaScript by Stormy482 (Patrick U):
// Discord: dev_storm (preferred) | Email: [email protected] | GitHub: stormy482 (https://github.com/stormy482)
//


Expand Down
7 changes: 3 additions & 4 deletions JavaScript/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,12 +48,12 @@ for (let y = 0; y < 128; y++) {
Since JavaScript does not support method overloading it has been simulated to make the user experience more continuous
between language versions.

Some of the code has been changed to use switch statments since it provided a minor preformance boost in some small
Some of the code has been changed to use switch statements since it provided a minor performance boost in some small
frequently used places eg the _Hash methods.

Here is a template for the method overloading:

```javascript
```js
class FastNoiseLite {
/**
* JSdoc
Expand All @@ -77,7 +77,6 @@ class FastNoiseLite {
}

}

```

### DM storm#8888 on discord or email w/ any questions or need any support or ask someone in our discord :D
### DM dev_storm on discord or email w/ any questions or need any support or ask someone in our discord :D
4 changes: 2 additions & 2 deletions JavaScript/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "fastnoise-lite",
"type": "module",
"version": "1.0.1",
"description": "an extremely portable open source noise generation library with a large selection of noise algorithms",
"description": "FastNoiseLite Lite is an extremely portable open source noise generation library with a large selection of noise algorithms",
"main": "FastNoiseLite.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
Expand Down Expand Up @@ -32,7 +32,7 @@
"random",
"generative"
],
"author": "Patrick U & Jordan Peck",
"contributors": ["Patrick U", "Jordan Peck"],
"license": "MIT",
"bugs": {
"url": "https://github.com/Auburn/FastNoiseLite/issues"
Expand Down

0 comments on commit e1a694d

Please sign in to comment.