Skip to content

Commit cef80e5

Browse files
Merge pull request #1 from httpland/beta
Beta
2 parents e26a314 + fa523f4 commit cef80e5

35 files changed

+4103
-35
lines changed
+40
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
name: "CodeQL"
2+
3+
on:
4+
push:
5+
branches: [ main ]
6+
7+
pull_request:
8+
branches: [ main ]
9+
10+
schedule:
11+
- cron: '18 15 * * 2'
12+
13+
jobs:
14+
analyze:
15+
name: Analyze
16+
runs-on: ubuntu-latest
17+
permissions:
18+
actions: read
19+
contents: read
20+
security-events: write
21+
22+
strategy:
23+
fail-fast: false
24+
matrix:
25+
language: [ 'typescript' ]
26+
27+
steps:
28+
- name: Checkout repository
29+
uses: actions/checkout@v3
30+
31+
- name: Initialize CodeQL
32+
uses: github/codeql-action/init@v2
33+
with:
34+
languages: ${{ matrix.language }}
35+
36+
- name: Autobuild
37+
uses: github/codeql-action/autobuild@v2
38+
39+
- name: Perform CodeQL Analysis
40+
uses: github/codeql-action/analyze@v2

.github/workflows/release-npm.yaml

+57
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
name: release-npm
2+
3+
on:
4+
release:
5+
types: [published]
6+
7+
jobs:
8+
release:
9+
runs-on: ${{ matrix.os }}
10+
11+
strategy:
12+
matrix:
13+
os: [ubuntu-latest]
14+
deno: [v1.x]
15+
node: [16.x]
16+
17+
steps:
18+
- name: Checkout
19+
uses: actions/checkout@v3
20+
21+
- uses: denoland/setup-deno@v1
22+
with:
23+
deno-version: ${{ matrix.deno }}
24+
25+
- name: Cache node_modules
26+
uses: actions/cache@v2
27+
with:
28+
path: ~/.pnpm-store
29+
key: ${{ runner.os }}-${{ hashFiles('**/pnpm-lock.yaml') }}
30+
restore-keys: |
31+
${{ runner.os }}-
32+
33+
- uses: pnpm/[email protected]
34+
with:
35+
version: 6.23.6
36+
run_install: |
37+
- recursive: true
38+
args: [--frozen-lockfile, --prefer-offline, --ignore-scripts]
39+
40+
- name: Get tag version
41+
if: startsWith(github.ref, 'refs/tags/')
42+
id: get_tag_version
43+
run: echo ::set-output name=TAG_VERSION::${GITHUB_REF/refs\/tags\//}
44+
45+
- uses: actions/setup-node@v2
46+
with:
47+
node-version: ${{ matrix.node }}
48+
registry-url: 'https://registry.npmjs.org'
49+
50+
- name: build
51+
run: deno run -A ./_tools/build_npm.ts ${{steps.get_tag_version.outputs.TAG_VERSION}}
52+
53+
- name: publish
54+
env:
55+
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
56+
run: deno run -A ./_tools/publish_npm.ts ${{steps.get_tag_version.outputs.TAG_VERSION}}
57+

.github/workflows/release.yaml

+79
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,79 @@
1+
name: release
2+
3+
on:
4+
push:
5+
branches:
6+
- beta
7+
- main
8+
9+
jobs:
10+
lint:
11+
runs-on: ${{ matrix.os }}
12+
13+
strategy:
14+
matrix:
15+
os: [ubuntu-latest]
16+
deno: [v1.x]
17+
18+
steps:
19+
- name: Checkout
20+
uses: actions/checkout@v3
21+
22+
- uses: denoland/setup-deno@v1
23+
with:
24+
deno-version: ${{ matrix.deno }}
25+
26+
- name: Lint
27+
run: |
28+
deno fmt --check
29+
deno lint
30+
31+
test:
32+
runs-on: ${{ matrix.os }}
33+
34+
strategy:
35+
matrix:
36+
os: [ubuntu-latest]
37+
deno: [v1.x]
38+
39+
steps:
40+
- name: Checkout
41+
uses: actions/checkout@v3
42+
43+
- uses: denoland/setup-deno@v1
44+
with:
45+
deno-version: ${{ matrix.deno }}
46+
47+
- name: Test
48+
run: deno task test --coverage=coverage
49+
50+
- name: Generate coverage
51+
if: ${{ matrix.deno == 'v1.x' }}
52+
run: deno coverage coverage --output=cov_profile.lcov --lcov
53+
54+
- uses: codecov/codecov-action@v3
55+
if: ${{ matrix.deno == 'v1.x' }}
56+
with:
57+
files: cov_profile.lcov
58+
59+
release:
60+
needs: [lint, test]
61+
runs-on: ${{ matrix.os }}
62+
63+
strategy:
64+
matrix:
65+
os: [ubuntu-latest]
66+
67+
steps:
68+
- name: Checkout
69+
uses: actions/checkout@v3
70+
with:
71+
token: ${{ secrets.GH_TOKEN }}
72+
73+
- uses: cycjimmy/semantic-release-action@v3
74+
with:
75+
extra_plugins: |
76+
@semantic-release/changelog
77+
@semantic-release/git
78+
env:
79+
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}

.github/workflows/test.yaml

+43
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
name: test
2+
3+
on: push
4+
jobs:
5+
lint:
6+
runs-on: ${{ matrix.os }}
7+
8+
strategy:
9+
matrix:
10+
os: [ubuntu-latest, ubuntu-22.04, macos-latest, windows-latest]
11+
deno: [v1.x]
12+
13+
steps:
14+
- name: Checkout
15+
uses: actions/checkout@v3
16+
17+
- uses: denoland/setup-deno@v1
18+
with:
19+
deno-version: ${{ matrix.deno }}
20+
21+
- name: Lint
22+
run: |
23+
deno fmt --check
24+
deno lint
25+
26+
test:
27+
runs-on: ${{ matrix.os }}
28+
29+
strategy:
30+
matrix:
31+
os: [ubuntu-latest, ubuntu-22.04, macos-latest, windows-latest]
32+
deno: [v1.x]
33+
34+
steps:
35+
- name: Checkout
36+
uses: actions/checkout@v3
37+
38+
- uses: denoland/setup-deno@v1
39+
with:
40+
deno-version: ${{ matrix.deno }}
41+
42+
- name: Test
43+
run: deno task test

.releaserc

+25
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
{
2+
"branches": [
3+
"main",
4+
{
5+
"name": "beta",
6+
"prerelease": true
7+
}
8+
],
9+
"plugins": [
10+
"@semantic-release/commit-analyzer",
11+
"@semantic-release/release-notes-generator",
12+
"@semantic-release/changelog",
13+
"@semantic-release/github",
14+
[
15+
"@semantic-release/git",
16+
{
17+
"assets": [
18+
"CHANGELOG.md"
19+
],
20+
"message": "chore(release): ${nextRelease.version} [skip ci]\n\n${nextRelease.notes}"
21+
}
22+
]
23+
],
24+
"tagFormat": "${version}"
25+
}

CHANGELOG.md

+34
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
# [1.0.0-beta.3](https://github.com/httpland/conditional-request-middleware/compare/1.0.0-beta.2...1.0.0-beta.3) (2023-03-29)
2+
3+
4+
### Bug Fixes
5+
6+
* **if_match:** change if-match header parser logic ([90a7a37](https://github.com/httpland/conditional-request-middleware/commit/90a7a378869091693b2f4586ba3b175c687d348b))
7+
8+
9+
### Features
10+
11+
* **mod:** export related types ([f4972a8](https://github.com/httpland/conditional-request-middleware/commit/f4972a847e67ed94abde7d1c71a88c3010542b4d))
12+
13+
# [1.0.0-beta.2](https://github.com/httpland/conditional-request-middleware/compare/1.0.0-beta.1...1.0.0-beta.2) (2023-03-27)
14+
15+
16+
### Features
17+
18+
* **middleware:** filter conditional headers if selecting representation ([8f37b6b](https://github.com/httpland/conditional-request-middleware/commit/8f37b6b973093f98ded5ac48f7298c011d224f9c))
19+
* **preconditions:** add checking accept-ranges header before evaluate if-ranges header ([13eb7cd](https://github.com/httpland/conditional-request-middleware/commit/13eb7cd8187dbcf241faf84eacde30494cee3403))
20+
21+
# 1.0.0-beta.1 (2023-03-24)
22+
23+
24+
### Features
25+
26+
* add conditional request middleware factory ([20af8fd](https://github.com/httpland/conditional-request-middleware/commit/20af8fd1e44fd63377979e07282ad02067dbdee8))
27+
* **middleware:** add support if-range header field ([f43a46a](https://github.com/httpland/conditional-request-middleware/commit/f43a46a496563409bad3b3743abd98ff06caba71))
28+
* **mod:** export types ([6d43a63](https://github.com/httpland/conditional-request-middleware/commit/6d43a63a504514b2cf34d232d214d6aff81cb76d))
29+
* **preconditions:** add if-match precondition ([c431571](https://github.com/httpland/conditional-request-middleware/commit/c431571601abcce6394170f7fc488bf2b13ac14e))
30+
* **preconditions:** add if-modified-since header field precondition ([621940d](https://github.com/httpland/conditional-request-middleware/commit/621940d3569d61278303b10ce7da122bd93ee18a))
31+
* **preconditions:** add if-none-match precondition ([f443b67](https://github.com/httpland/conditional-request-middleware/commit/f443b67864731491a49df205a84691483d247abe))
32+
* **preconditions:** add if-range field precondition ([6d62c8a](https://github.com/httpland/conditional-request-middleware/commit/6d62c8ab4a1711be202d23291a425b3b01aa641a))
33+
* **preconditions:** add If-Unmodified-Since header precondition ([43aab36](https://github.com/httpland/conditional-request-middleware/commit/43aab36fe225706e916c55e763a592c981d33bd6))
34+
* **preconditions:** use strict if-none-match field parser ([ec6157e](https://github.com/httpland/conditional-request-middleware/commit/ec6157ea0567f238532b65e8e6766d62cd342d2d))

0 commit comments

Comments
 (0)