Skip to content

Commit daf187d

Browse files
fix: releasing itself
1 parent e137594 commit daf187d

11 files changed

+68939
-71
lines changed

.github/workflows/release.yml

+63
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
name: Release
2+
3+
env:
4+
# Use docker.io for Docker Hub if empty
5+
REGISTRY: ghcr.io
6+
# github.repository as <account>/<repo>
7+
IMAGE_NAME: ${{ github.repository }}
8+
9+
concurrency:
10+
group: "${{ github.workflow }}"
11+
cancel-in-progress: true # only last step is important, which runs or doesn't
12+
13+
on:
14+
workflow_dispatch: # releasing is manual as we don't want to release every time
15+
16+
permissions:
17+
contents: write # to write tags
18+
packages: write # to write tags to Docker registry
19+
issues: write
20+
pull-requests: write
21+
id-token: write # to enable use of OIDC for npm provenance
22+
23+
jobs:
24+
release:
25+
name: Release
26+
runs-on: ubuntu-latest
27+
steps:
28+
- name: Only on main
29+
if: github.ref != 'refs/heads/main'
30+
shell: bash
31+
run: |
32+
echo "Only to be executed on main"
33+
exit 1
34+
35+
- name: Checkout
36+
uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4.1.0
37+
with:
38+
show-progress: false
39+
40+
- name: Setup Node.js
41+
uses: actions/setup-node@5e21ff4d9bc1a8cf6de233a3057d20ec6b3fb69d # v3.8.1
42+
with:
43+
node-version-file: ".nvmrc"
44+
cache: "npm"
45+
cache-dependency-path: "**/package-lock.json"
46+
47+
- name: Install dependencies
48+
shell: bash
49+
run: |
50+
npm ci --ignore-scripts
51+
52+
- name: Build
53+
shell: bash
54+
run: |
55+
npm run build
56+
57+
- name: Release
58+
env:
59+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
60+
NPM_TOKEN: ${{ secrets.GITHUB_TOKEN }}
61+
shell: bash
62+
run: |
63+
npm run release

.github/workflows/test-release.yml

+52
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
name: Test Release (do a dry run)
2+
3+
env:
4+
# Use docker.io for Docker Hub if empty
5+
REGISTRY: ghcr.io
6+
# github.repository as <account>/<repo>
7+
IMAGE_NAME: ${{ github.repository }}
8+
9+
on:
10+
workflow_dispatch: # releasing is manual as we don't want to release every time
11+
12+
permissions:
13+
contents: write
14+
issues: read
15+
pull-requests: read
16+
17+
jobs:
18+
release:
19+
name: Release
20+
runs-on: ubuntu-latest
21+
steps:
22+
- name: Only on main
23+
if: github.ref != 'refs/heads/main'
24+
shell: bash
25+
run: |
26+
echo "Only to be executed on main"
27+
exit 1
28+
29+
- name: Checkout
30+
uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4.1.0
31+
with:
32+
show-progress: false
33+
34+
- name: Setup Node.js
35+
uses: actions/setup-node@5e21ff4d9bc1a8cf6de233a3057d20ec6b3fb69d # v3.8.1
36+
with:
37+
node-version-file: ".nvmrc"
38+
cache: "npm"
39+
cache-dependency-path: "**/package-lock.json"
40+
41+
- name: Install dependencies
42+
shell: bash
43+
run: |
44+
npm ci --ignore-scripts
45+
46+
- name: Release
47+
shell: bash
48+
env:
49+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
50+
NPM_TOKEN: ${{ secrets.GITHUB_TOKEN }}
51+
run: |
52+
npm run release -- --dry-run

.releaserc.yml

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
---
2+
plugins:
3+
- - "@semantic-release/commit-analyzer"
4+
- preset: conventionalcommits
5+
- - "@semantic-release/release-notes-generator"
6+
- preset: conventionalcommits
7+
- "@semantic-release/github"
8+
branches:
9+
- name: main

.vscode/settings.json

+5-1
Original file line numberDiff line numberDiff line change
@@ -1 +1,5 @@
1-
{}
1+
{
2+
"jest.autoRevealOutput": "on-run",
3+
"jest.jestCommandLine": "node_modules/.bin/jest",
4+
"jest.showCoverageOnLoad": true
5+
}

dist/index.js

+68,697-5
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

jest.config.ts

+3-3
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ const config: Config = {
1919
collectCoverage: false,
2020

2121
// An array of glob patterns indicating a set of files for which coverage information should be collected
22-
collectCoverageFrom: ["<rootDir>/src/**/*.ts"],
22+
collectCoverageFrom: ["<rootDir>/src/**/*.ts", "!<rootDir>/src/**/*.d.ts"],
2323

2424
// The directory where Jest should output its coverage files
2525
coverageDirectory: "coverage",
@@ -90,7 +90,7 @@ const config: Config = {
9090
reporters: ["default"],
9191

9292
// Automatically reset mock state between every test
93-
// resetMocks: false,
93+
resetMocks: true,
9494

9595
// Reset the module registry before running each individual test
9696
// resetModules: false,
@@ -99,7 +99,7 @@ const config: Config = {
9999
// resolver: undefined,
100100

101101
// Automatically restore mock state between every test
102-
// restoreMocks: false,
102+
restoreMocks: true,
103103

104104
// The root directory that Jest should scan for tests and modules within
105105
rootDir: "./",

0 commit comments

Comments
 (0)