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

Commit 70a6593

Browse files
committed
add dependabot and publish on tag push
1 parent a0f10aa commit 70a6593

File tree

6 files changed

+175
-0
lines changed

6 files changed

+175
-0
lines changed

.github/ISSUE_TEMPLATE/bug_report.md

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: "pip" # See documentation for possible values
9+
directory: "/" # Location of package manifests
10+
schedule:
11+
interval: "weekly"

.github/workflows/release_package.yml

Lines changed: 100 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,100 @@
1+
name: Release Python 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 Python environment
15+
- name: Setup Python
16+
uses: actions/setup-python@v4
17+
with:
18+
python-version: "3.9"
19+
20+
# Install dependencies
21+
- name: Install dependencies
22+
run: |
23+
python -m pip install --upgrade pip
24+
pip install wheel twine
25+
26+
# Extract version from tag
27+
- name: Get version from tag
28+
run: echo "NEW_VERSION=${GITHUB_REF#refs/tags/v}" >> $GITHUB_ENV
29+
30+
# Determine if it's a pre-release
31+
- name: Check if pre-release
32+
run: |
33+
if [[ ${{ env.NEW_VERSION }} == *"-"* ]]; then
34+
echo "RELEASE_TAG=beta" >> $GITHUB_ENV
35+
else
36+
echo "RELEASE_TAG=latest" >> $GITHUB_ENV
37+
fi
38+
39+
# Update changelog unreleased section with new version
40+
- name: Update changelog
41+
uses: superfaceai/release-changelog-action@v1
42+
with:
43+
path-to-changelog: CHANGELOG.md
44+
version: ${{ env.NEW_VERSION }}
45+
operation: release
46+
47+
- name: Update version
48+
run: |
49+
sed -i "s/version=.*,/version='${{ env.NEW_VERSION }}',/" setup.py
50+
51+
# Configure Git
52+
- name: Git configuration
53+
run: |
54+
git config --global user.email "41898282+github-actions[bot]@users.noreply.github.com"
55+
git config --global user.name "GitHub Actions"
56+
57+
# Commit changes
58+
- name: Commit version and changelog
59+
run: |
60+
git add CHANGELOG.md
61+
git add setup.py
62+
git commit -m "chore: release ${{ env.NEW_VERSION }}"
63+
git tag v${{ env.NEW_VERSION }}
64+
65+
# Push changes and tags
66+
- name: Push changes
67+
env:
68+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
69+
run: |
70+
git push origin HEAD:main
71+
72+
# Build package
73+
- name: Build package
74+
run: python setup.py sdist bdist_wheel
75+
76+
# Publish to PyPI
77+
- name: Publish to PyPI
78+
env:
79+
TWINE_USERNAME: "__token__"
80+
TWINE_PASSWORD: ${{ secrets.TWINE_PASSWORD }}
81+
run: twine upload dist/*
82+
83+
# Read version changelog
84+
- id: get-changelog
85+
name: Get version changelog
86+
uses: superfaceai/release-changelog-action@v1
87+
with:
88+
path-to-changelog: CHANGELOG.md
89+
version: ${{ env.NEW_VERSION }}
90+
operation: read
91+
92+
# Update GitHub release with changelog
93+
- name: Update GitHub release documentation
94+
uses: softprops/action-gh-release@v1
95+
with:
96+
tag_name: ${{ env.NEW_VERSION }}
97+
body: ${{ steps.get-changelog.outputs.changelog }}
98+
prerelease: ${{ startsWith(github.event.inputs.release-type, 'pre') }}
99+
env:
100+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

CHANGELOG.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# Changelog
2+
3+
All notable changes to this project will be documented in this file.
4+
5+
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
6+
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7+
8+
## Unreleased

0 commit comments

Comments
 (0)