Skip to content
This repository was archived by the owner on Mar 25, 2025. It is now read-only.

Commit 5e425d4

Browse files
committed
new tag auto publish
1 parent 8d867e4 commit 5e425d4

File tree

7 files changed

+167
-0
lines changed

7 files changed

+167
-0
lines changed
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
---
2+
name: Bug report
3+
about: Create a report to help us improve
4+
title: ""
5+
labels: ""
6+
assignees: ""
7+
---
8+
9+
**Describe the bug**
10+
A clear and concise description of what the bug is.
11+
12+
**To Reproduce**
13+
Steps to reproduce the behavior:
14+
15+
1.
16+
2.
17+
3.
18+
19+
**Expected behavior**
20+
A clear and concise description of what you expected to happen.
21+
22+
**Screenshots**
23+
If applicable, add screenshots to help explain your problem.
24+
25+
**Desktop (please complete the following information):**
26+
27+
- OS: [e.g. Ubuntu 22.04, macOS 11.4]
28+
- Node version [e.g 16.4.2]
29+
- Code Version [e.g. 1.1.0]
30+
31+
**Additional context**
32+
Add any other context about the problem here.

.github/ISSUE_TEMPLATE/config.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
blank_issues_enabled: false
2+
contact_links:
3+
- name: GitHub Discussions
4+
url: https://github.com/apitoolkit/apitoolkit-express/discussions
5+
about: Please discuss non bug-related topics there
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
---
2+
name: Feature request
3+
about: Suggest an idea for this project
4+
title: ""
5+
labels: ""
6+
assignees: ""
7+
---
8+
9+
**Is your feature request related to a problem? Please describe.**
10+
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
11+
12+
**Describe the solution you'd like**
13+
A clear and concise description of what you want to happen.
14+
15+
**Describe alternatives you've considered**
16+
A clear and concise description of any alternative solutions or features you've considered.
17+
18+
**Additional context**
19+
Add any other context or screenshots about the feature request here.

.github/dependabot.yml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
# To get started with Dependabot version updates, you'll need to specify which
2+
# package ecosystems to update and where the package manifests are located.
3+
# Please see the documentation for all configuration options:
4+
# https://docs.github.com/code-security/dependabot/dependabot-version-updates/configuration-options-for-the-dependabot.yml-file
5+
6+
version: 2
7+
updates:
8+
- package-ecosystem: "npm" # See documentation for possible values
9+
directory: "/" # Location of package manifests
10+
schedule:
11+
interval: "weekly"
Lines changed: 99 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,99 @@
1+
name: Release package
2+
on:
3+
push:
4+
tags:
5+
- 'v*'
6+
jobs:
7+
release:
8+
runs-on: ubuntu-latest
9+
steps:
10+
# Checkout project repository
11+
- name: Checkout
12+
uses: actions/checkout@v3
13+
14+
# Setup Node.js environment
15+
- name: Setup Node.js
16+
uses: actions/setup-node@v3
17+
with:
18+
node-version: '16'
19+
registry-url: 'https://registry.npmjs.org'
20+
21+
- name: Install dependencies
22+
run: npm install
23+
24+
- run: npm run build
25+
26+
# Configure Git
27+
- name: Git configuration
28+
run: |
29+
git config --global user.email "41898282+github-actions[bot]@users.noreply.github.com"
30+
git config --global user.name "GitHub Actions"
31+
32+
# Extract version from tag
33+
- name: Get version from tag
34+
run: echo "NEW_VERSION=${GITHUB_REF#refs/tags/v}" >> $GITHUB_ENV
35+
36+
# Determine if it's a pre-release
37+
- name: Check if pre-release
38+
run: |
39+
if [[ ${{ env.NEW_VERSION }} == *"-"* ]]; then
40+
echo "RELEASE_TAG=beta" >> $GITHUB_ENV
41+
else
42+
echo "RELEASE_TAG=latest" >> $GITHUB_ENV
43+
fi
44+
45+
# Update changelog unreleased section with new version
46+
- name: Update changelog
47+
uses: superfaceai/release-changelog-action@v1
48+
with:
49+
path-to-changelog: CHANGELOG.md
50+
version: ${{ env.NEW_VERSION }}
51+
operation: release
52+
53+
# Bump version in package.json
54+
- name: Bump version
55+
run: npm version ${{ env.NEW_VERSION }} --no-git-tag-version
56+
57+
- name: Create and checkout temporary branch
58+
run: |
59+
git branch temp-branch
60+
git checkout temp-branch
61+
62+
# Commit changes
63+
- name: Commit CHANGELOG.md and package.json changes and create tag
64+
run: |
65+
git add "CHANGELOG.md"
66+
git add "package.json"
67+
git commit -m "chore: release ${{ env.NEW_VERSION }}"
68+
69+
# Push repository changes
70+
- name: Push changes to repository
71+
env:
72+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
73+
run: |
74+
git push origin temp-branch:main
75+
76+
# Publish version to npmdd
77+
- name: Publish
78+
run: yarn publish --verbose --access public --tag ${{ env.RELEASE_TAG }}
79+
env:
80+
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
81+
82+
# Read version changelog
83+
- id: get-changelog
84+
name: Get version changelog
85+
uses: superfaceai/release-changelog-action@v1
86+
with:
87+
path-to-changelog: CHANGELOG.md
88+
version: ${{ env.NEW_VERSION }}
89+
operation: read
90+
91+
# Update GitHub release with changelog
92+
- name: Update GitHub release documentation
93+
uses: softprops/action-gh-release@v1
94+
with:
95+
tag_name: ${{ env.NEW_VERSION }}
96+
body: ${{ steps.get-changelog.outputs.changelog }}
97+
prerelease: ${{ startsWith(github.event.inputs.release-type, 'pre') }}
98+
env:
99+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

CHANGELOG.md

Whitespace-only changes.

src/middleware/apitoolkit_middleware.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -136,6 +136,7 @@ export default class APIToolkitMiddleware {
136136
public middleware() {
137137
const project_id = this.#project_id
138138
const config = this.#config
139+
// eslint-disable-next-line @typescript-eslint/no-this-alias
139140
const client = this
140141
class middleware {
141142
#project_id: string | undefined

0 commit comments

Comments
 (0)