Skip to content

Commit

Permalink
Merge pull request #1 from httpland/beta
Browse files Browse the repository at this point in the history
Beta
  • Loading branch information
TomokiMiyauci committed Apr 19, 2023
2 parents 8a1c395 + 8206819 commit 3df970c
Show file tree
Hide file tree
Showing 19 changed files with 666 additions and 74 deletions.
42 changes: 42 additions & 0 deletions .github/workflows/codeql-analysis.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
name: "CodeQL"

on:
push:
branches:
- main

pull_request:
branches:
- main

schedule:
- cron: '18 15 * * 2'

jobs:
analyze:
name: Analyze
runs-on: ubuntu-latest
permissions:
actions: read
contents: read
security-events: write

strategy:
fail-fast: false
matrix:
language: [ 'typescript' ]

steps:
- name: Checkout repository
uses: actions/checkout@v3

- name: Initialize CodeQL
uses: github/codeql-action/init@v2
with:
languages: ${{ matrix.language }}

- name: Autobuild
uses: github/codeql-action/autobuild@v2

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v2
57 changes: 57 additions & 0 deletions .github/workflows/release-npm.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
name: release-npm

on:
release:
types: [published]

jobs:
release:
runs-on: ${{ matrix.os }}

strategy:
matrix:
os: [ubuntu-latest]
deno: [v1.x]
node: [16.x]

steps:
- name: Checkout
uses: actions/checkout@v3

- uses: denoland/setup-deno@v1
with:
deno-version: ${{ matrix.deno }}

- name: Cache node_modules
uses: actions/cache@v2
with:
path: ~/.pnpm-store
key: ${{ runner.os }}-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-
- uses: pnpm/action-setup@v2.0.1
with:
version: 6.23.6
run_install: |
- recursive: true
args: [--frozen-lockfile, --prefer-offline, --ignore-scripts]
- name: Get tag version
if: startsWith(github.ref, 'refs/tags/')
id: get_tag_version
run: echo ::set-output name=TAG_VERSION::${GITHUB_REF/refs\/tags\//}

- uses: actions/setup-node@v2
with:
node-version: ${{ matrix.node }}
registry-url: 'https://registry.npmjs.org'

- name: build
run: deno run -A ./_tools/build_npm.ts ${{steps.get_tag_version.outputs.TAG_VERSION}}

- name: publish
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
run: deno run -A ./_tools/publish_npm.ts ${{steps.get_tag_version.outputs.TAG_VERSION}}

77 changes: 77 additions & 0 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
name: release

on:
push:
branches:
- beta
- main

jobs:
lint:
runs-on: ${{ matrix.os }}

strategy:
matrix:
os: [ubuntu-latest]
deno: [v1.x]

steps:
- name: Checkout
uses: actions/checkout@v3

- uses: denoland/setup-deno@v1
with:
deno-version: ${{ matrix.deno }}

- name: Lint
run: |
deno fmt --check
deno lint
test:
runs-on: ${{ matrix.os }}

strategy:
matrix:
os: [ubuntu-latest]
deno: [v1.x]

steps:
- name: Checkout
uses: actions/checkout@v3

- uses: denoland/setup-deno@v1
with:
deno-version: ${{ matrix.deno }}

- name: Test
run: deno task test --coverage=coverage

- name: Generate coverage
run: deno coverage coverage --output=cov_profile.lcov --lcov

- uses: codecov/codecov-action@v3
with:
files: cov_profile.lcov

release:
needs: [lint, test]
runs-on: ${{ matrix.os }}

strategy:
matrix:
os: [ubuntu-latest]

steps:
- name: Checkout
uses: actions/checkout@v3
with:
token: ${{ secrets.GH_TOKEN }}

- uses: cycjimmy/semantic-release-action@v3
with:
extra_plugins: |
@semantic-release/changelog
@semantic-release/git
env:
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}
43 changes: 43 additions & 0 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
name: test

on: push
jobs:
lint:
runs-on: ${{ matrix.os }}

strategy:
matrix:
os: [ubuntu-latest, ubuntu-22.04, macos-latest, windows-latest]
deno: [v1.x]

steps:
- name: Checkout
uses: actions/checkout@v3

- uses: denoland/setup-deno@v1
with:
deno-version: ${{ matrix.deno }}

- name: Lint
run: |
deno fmt --check
deno lint
test:
runs-on: ${{ matrix.os }}

strategy:
matrix:
os: [ubuntu-latest, ubuntu-22.04, macos-latest, windows-latest]
deno: [v1.x]

steps:
- name: Checkout
uses: actions/checkout@v3

- uses: denoland/setup-deno@v1
with:
deno-version: ${{ matrix.deno }}

- name: Test
run: deno task test
25 changes: 25 additions & 0 deletions .releaserc
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
{
"branches": [
"main",
{
"name": "beta",
"prerelease": true
}
],
"plugins": [
"@semantic-release/commit-analyzer",
"@semantic-release/release-notes-generator",
"@semantic-release/changelog",
"@semantic-release/github",
[
"@semantic-release/git",
{
"assets": [
"CHANGELOG.md"
],
"message": "chore(release): ${nextRelease.version} [skip ci]\n\n${nextRelease.notes}"
}
]
],
"tagFormat": "${version}"
}
10 changes: 10 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# 1.0.0-beta.1 (2023-04-19)


### Features

* add CORS middleware factory ([6497fcf](https://github.com/httpland/cors-middleware/commit/6497fcfa3bb1d360005bbfcabf2d12d0be3355a7))
* add preflight middleware factory ([ab4758a](https://github.com/httpland/cors-middleware/commit/ab4758ad029e830912f1065e9ef2900331cc7daf))
* **middleware:** add validation for argument ([b532831](https://github.com/httpland/cors-middleware/commit/b5328313a8823be24612a9b1c4be86401e2f852b))
* **middleware:** rename CORS types ([9b99a36](https://github.com/httpland/cors-middleware/commit/9b99a365774290e3f174c8d479877e3b58767cc8))
* **mod:** export related types ([5d96fa7](https://github.com/httpland/cors-middleware/commit/5d96fa76124da5bec7613660f838ac88bb712a5c))
Loading

0 comments on commit 3df970c

Please sign in to comment.