Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
78 changes: 78 additions & 0 deletions .github/workflows/build-and-publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
name: build and publish

on:
pull_request:

jobs:
check_and_build:
runs-on: ubuntu-latest
permissions:
id-token: write
outputs:
s3_bucket_key: ${{ steps.publish_package.outputs.s3-bucket-key }}
steps:
- uses: actions/checkout@v4
- name: Use Node.js 20.x
uses: actions/setup-node@v3
with:
node-version: 20.x
cache: npm
- name: install
run: npm ci
- name: build
run: make build
- name: test
run: make test bench
- name: Publish
uses: menduz/oddish-action@master
id: publish_package
with:
registry-url: 'https://registry.npmjs.org'
access: public
## use action runId instead of current date to generate snapshot numbers
deterministic-snapshot: true

## publish every package to s3
s3-bucket: ${{ secrets.SDK_TEAM_S3_BUCKET }}
s3-bucket-key-prefix: '@dcl/${{ github.event.repository.name }}/branch/${{ github.head_ref }}'
s3-bucket-region: ${{ secrets.SDK_TEAM_AWS_REGION }}

## inform gitlab after publishing to proceed with CDN propagation
gitlab-token: ${{ secrets.GITLAB_TOKEN }}
gitlab-pipeline-url: ${{ secrets.GITLAB_URL }}
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
AWS_DEFAULT_REGION: us-east-1
AWS_ACCESS_KEY_ID: ${{ secrets.SDK_TEAM_AWS_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.SDK_TEAM_AWS_SECRET }}

notify_deployment:
needs: [check_and_build]
if: ${{ github.event.pull_request.number && !startsWith(github.head_ref, 'dependabot/') }}
runs-on: ubuntu-latest
name: Deployment Notification
steps:
- name: Find Comment
uses: peter-evans/find-comment@v3
id: fc
with:
issue-number: ${{ github.event.pull_request.number }}
comment-author: 'github-actions[bot]'
body-includes: Test this pull request

- name: Generate S3 URL
id: url-generator
run: echo "body=${{ secrets.SDK_TEAM_S3_BASE_URL }}/${{ needs.check_and_build.outputs.s3_bucket_key }}" >> $GITHUB_OUTPUT

- name: Create or update comment
uses: peter-evans/create-or-update-comment@v4
with:
comment-id: ${{ steps.fc.outputs.comment-id }}
issue-number: ${{ github.event.pull_request.number }}
body: |
# Test this pull request
- The package can be tested by running
```bash
npm upgrade "${{ steps.url-generator.outputs.body }}"
```
edit-mode: replace
35 changes: 0 additions & 35 deletions .github/workflows/ci.yml

This file was deleted.

37 changes: 37 additions & 0 deletions .github/workflows/master.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
on:
push:
branches:
- master
- main
tags:
- '*'
release:
types:
- created

name: Publish NPM package
jobs:
install:
permissions:
id-token: write
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Use Node.js 18.x
uses: actions/setup-node@v4
with:
node-version: 18.x

- name: npm ci
run: npm ci
- name: build
run: make build
- name: test
run: make test bench

- name: Publish
uses: menduz/oddish-action@master
with:
access: public
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
22 changes: 22 additions & 0 deletions .github/workflows/pr.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
on:
push:
branches-ignore:
- "main"
pull_request:

name: PR Validation
jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Use Node.js 18.x
uses: actions/setup-node@v4
with:
node-version: 18.x
- name: npm ci
run: npm ci
- name: build
run: make build
- name: test
run: make test bench
4 changes: 1 addition & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,9 @@ install:

build:
./node_modules/.bin/tsc -p tsconfig.json
rm -rf node_modules/@microsoft/api-extractor/node_modules/typescript || true
./node_modules/.bin/api-extractor run $(LOCAL_ARG) --typescript-compiler-folder ./node_modules/typescript

test:
node --inspect ./node_modules/.bin/jest --forceExit --detectOpenHandles --coverage --verbose $(TEST_FILE)
./node_modules/.bin/jest --forceExit --detectOpenHandles --coverage --verbose $(TEST_FILE)

test-esm:
node --experimental-vm-modules ./node_modules/.bin/jest --forceExit --detectOpenHandles --coverage --verbose
Expand Down
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
# http-server
# wkc-http-server

forked from https://github.com/well-known-components/http-server
Loading
Loading