Skip to content

Commit

Permalink
feat: add gha to release npm package when publishing new release on gh (
Browse files Browse the repository at this point in the history
#6)

* feat: add gha to release npm package when publishing new release on gh

* fix: lint
  • Loading branch information
Bemilie authored Apr 13, 2023
1 parent 95645e3 commit 69c1092
Show file tree
Hide file tree
Showing 17 changed files with 41 additions and 668 deletions.
2 changes: 1 addition & 1 deletion .github/CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ We always appreciate a well-written, thorough bug report, and will thank you for
Before opening a new issue, we appreciate you reviewing open issues to see if there are any similar requests.
If there is a match, thumbs up the issue with a 👍 and leave a comment if you have additional information.

When reporting an issue, please include the npm version number of `scaleway-functions-node` that you are using.
When reporting an issue, please include the npm version number of `@scaleway/serverless-functions` that you are using.

## Suggesting a feature

Expand Down
26 changes: 26 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: Publish to NPM

on:
release:
types: [published]

jobs:
release:
runs-on: ubuntu-22.04
steps:
- name: Checkout
uses: actions/checkout@v2

- name: Setup Node
uses: actions/setup-node@v2
with:
node-version: "18"
registry-url: "https://registry.npmjs.org"

- name: Install dependencies and build
run: npm ci && npm run build

- name: Publish package on NPM
run: npm publish --access public
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ function handle(event, context, callback) {
// Module was not imported but called directly, so we can test locally.
// This will not be executed on Scaleway Functions
if (import.meta.url === pathToFileURL(process.argv[1]).href) {
import("scaleway-functions-node").then(scw_fnc_node => {
import("@scaleway/serverless-functions").then(scw_fnc_node => {
scw_fnc_node.serveHandler(handle, 8080);
});
}
Expand Down
2 changes: 1 addition & 1 deletion examples/not_stringified_body/handler.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ export function handle(event, context, callback) {
/* Module was not imported but called directly, so we can test locally.
This will not be executed on Scaleway Functions */
if (import.meta.url === pathToFileURL(process.argv[1]).href) {
import("scaleway-functions-node").then(scw_fnc_node => {
import("@scaleway/serverless-functions").then(scw_fnc_node => {
scw_fnc_node.serveHandler(handle, 8080);
});
}
Loading

0 comments on commit 69c1092

Please sign in to comment.