-
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.
Merge pull request #1 from httpland/beta
Beta
- Loading branch information
Showing
19 changed files
with
643 additions
and
6 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 |
---|---|---|
@@ -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 |
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 |
---|---|---|
@@ -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}} | ||
|
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 |
---|---|---|
@@ -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 }} |
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 |
---|---|---|
@@ -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 |
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 |
---|---|---|
@@ -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}" | ||
} |
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 |
---|---|---|
@@ -0,0 +1,20 @@ | ||
# [1.0.0-beta.3](https://github.com/httpland/hsts-middleware/compare/1.0.0-beta.2...1.0.0-beta.3) (2023-03-18) | ||
|
||
|
||
### Features | ||
|
||
* **mod:** export related types ([30de550](https://github.com/httpland/hsts-middleware/commit/30de55028cf46e349e40cc0e71a5ab773f6f1640)) | ||
|
||
# [1.0.0-beta.2](https://github.com/httpland/hsts-middleware/compare/1.0.0-beta.1...1.0.0-beta.2) (2023-03-18) | ||
|
||
|
||
### Features | ||
|
||
* **utils:** add preset for recommended sts value ([c63de41](https://github.com/httpland/hsts-middleware/commit/c63de419cc40bc38b9d59e8861c3540b1ca12f2e)) | ||
|
||
# 1.0.0-beta.1 (2023-03-17) | ||
|
||
|
||
### Features | ||
|
||
* **middleware:** add HSTS header middleware factory ([4ead771](https://github.com/httpland/hsts-middleware/commit/4ead771fd712af62524758b8e4fc0beb7306c88a)) |
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 |
---|---|---|
@@ -0,0 +1,7 @@ | ||
export { | ||
assert, | ||
assertEquals, | ||
assertThrows, | ||
} from "https://deno.land/std@0.180.0/testing/asserts.ts"; | ||
export { describe, it } from "https://deno.land/std@0.180.0/testing/bdd.ts"; | ||
export { equalsResponse } from "https://deno.land/x/http_utils@1.0.0-beta.13/response.ts"; |
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 |
---|---|---|
@@ -0,0 +1,5 @@ | ||
{ | ||
"imports": { | ||
"https://deno.land/x/hsts_middleware@$VERSION/": "./" | ||
} | ||
} |
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 |
---|---|---|
@@ -0,0 +1,23 @@ | ||
import { build, emptyDir } from "https://deno.land/x/dnt@0.33.1/mod.ts"; | ||
import { join } from "https://deno.land/std@0.177.0/path/mod.ts"; | ||
import { makeOptions } from "./meta.ts"; | ||
|
||
async function buildPkg(version: string): Promise<void> { | ||
await emptyDir("./npm"); | ||
const pkg = makeOptions(version); | ||
await Deno.copyFile("LICENSE", join(pkg.outDir, "LICENSE")); | ||
Deno.copyFile( | ||
join(".", "README.md"), | ||
join(pkg.outDir, "README.md"), | ||
); | ||
await build(pkg); | ||
} | ||
|
||
if (import.meta.main) { | ||
const version = Deno.args[0]; | ||
if (!version) { | ||
console.error("argument is required"); | ||
Deno.exit(1); | ||
} | ||
await buildPkg(version); | ||
} |
Oops, something went wrong.