Skip to content

Commit 85d6a5e

Browse files
SunsetWolfyou-n-g
andauthored
fix: fix release CI (#165)
* test fix release CI * test fix release CI * test fix release CI * test fix release CI * test fix release CI * test fix release CI * test fix release CI * test fix release CI * remove bump2version from release CI * change code * split release CI * format with toml-sort * change triggers * Update pyproject.toml * optimize code * fix sort-toml error * merge release & upload * fix release error * test release ci * test release ci * test release ci * test release ci * test release ci * test release ci * test release ci * test release ci * test release ci * test release ci * test release ci * test release ci * test release ci * test release ci * test release ci --------- Co-authored-by: you-n-g <[email protected]>
1 parent 5e14fa5 commit 85d6a5e

File tree

6 files changed

+35
-51
lines changed

6 files changed

+35
-51
lines changed

.github/PULL_REQUEST_TEMPLATE.md

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,15 @@
1-
<!--- Thank you for submitting a Pull Request! In order to make our work smoother, please make sure your Pull Request meets the following requirements: 1. Provide a general summary of your changes in the Title above; 2. Add appropriate prefixes to titles, such as `build:`, `chore:`, `ci:`, `deps:`, `doc:`, `docs:`, `feat:`, `fix:`, `perf:`, `ref:`, `refactor:`, `revert:`, `style:`, `test:`, `tests:`. -->
1+
<!--- Thank you for submitting a Pull Request! In order to make our work smoother. -->
2+
<!--- please make sure your Pull Request meets the following requirements: -->
3+
<!--- 1. Provide a general summary of your changes in the Title above; -->
4+
<!--- 2. Add appropriate prefixes to titles, such as `build:`, `chore:`, `ci:`, `docs:`, `feat:`, `fix:`, `perf:`, `refactor:`, `revert:`, `style:`, `test:`(Ref: https://www.conventionalcommits.org/). -->
5+
<!--- Category: -->
6+
<!--- Patch Updates: `fix:` -->
7+
<!--- Example: fix(auth): correct login validation issue -->
8+
<!--- minor update (introduces new functionality): `feat` -->
9+
<!--- Example: feature(parser): add ability to parse arrays -->
10+
<!--- major update(destructive update): Include BREAKING CHANGE in the commit message footer, or add `! ` in the commit footer to indicate that there is a destructive update. -->
11+
<!--- Example: feat(auth)! : remove support for old authentication method -->
12+
<!--- Other updates: `build:`, `chore:`, `ci:`, `docs:`, `perf:`, `refactor:`, `revert:`, `style:`, `test:`. -->
213

314
## Description
415
<!--- Describe your changes in detail -->

.github/workflows/ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,4 +67,4 @@ on:
6767
- synchronize
6868
push:
6969
branches:
70-
- main
70+
- main

.github/workflows/pr.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ jobs:
77
steps:
88
- name: Check PR Title for Conventional Commit Format
99
run: |
10-
if ! echo "${{ github.event.pull_request.title }}" | grep -Pq '^(build|chore|ci|deps|doc|docs|feat|fix|perf|ref|refactor|revert|style|test|tests|Bump version)(\(\w+\))?!?:\s.*'; then
10+
if ! echo "${{ github.event.pull_request.title }}" | grep -Pq '^(build|chore|ci|docs|feat|fix|perf|refactor|revert|style|test)(\(\w+\))?!?:\s.*'; then
1111
echo 'The title does not conform to the Conventional Commit.'
1212
echo 'Please refer to "https://www.conventionalcommits.org/"'
1313
exit 1

.github/workflows/release.yml

Lines changed: 17 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -23,51 +23,22 @@ jobs:
2323
- name: Install dependencies
2424
run: |
2525
python -m pip install --upgrade pip
26-
pip install setuptools wheel twine bump2version git-changelog # better-exceptions(optional for debug)
27-
- name: Bump version
28-
run: |
29-
git config --global user.name 'github-actions[bot]'
30-
git config --global user.email 'github-actions[bot]@users.noreply.github.com'
31-
bump2version patch
32-
NEW_VERSION=$(grep -Po '(?<=^version = ")[^"]*' pyproject.toml)
33-
echo "new_version=$NEW_VERSION" >> $GITHUB_ENV
34-
echo "New version: $NEW_VERSION"
35-
- name: Push changes
26+
pip install setuptools wheel twine # better-exceptions(optional for debug)
27+
- name: Release please
28+
id: release_please
29+
uses: googleapis/release-please-action@v4
30+
with:
31+
# The current PAT (personal access token) was created on 2024-08-05,
32+
# since the maximum validity of PAT is 1 year, you need to change the PAT before 2025-08-05.
33+
token: ${{ secrets.PAT }}
34+
release-type: simple
35+
- run: env | sort
36+
- run: make dev
37+
- run: make build
38+
- name: upload
39+
if: ${{ steps.release.outputs.release_created }}
3640
env:
37-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
38-
run: |
39-
echo "${{ secrets.PRIVATE_KEY }}" >> ~/private_key
40-
chmod 600 ~/private_key
41-
GIT_SSH_COMMAND="ssh -i ~/private_key" git push --follow-tags
42-
- name: Generate changelog
41+
TWINE_USERNAME: __token__
42+
TWINE_PASSWORD: ${{ secrets.PYPI_TOKEN }}
4343
run: |
44-
make changelog
45-
- name: Prepare release notes
46-
run: make release-notes > release-notes.md
47-
- name: Create GitHub release
48-
uses: softprops/action-gh-release@v2
49-
env:
50-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
51-
with:
52-
tag_name: ${{ env.new_version }}
53-
release_name: Release ${{ env.new_version }}
54-
body_path: release-notes.md
55-
prerelease: false
56-
# package:
57-
# needs: release
58-
# runs-on: ubuntu-latest
59-
# steps:
60-
# - uses: actions/checkout@v4
61-
# - name: Set up Python
62-
# uses: actions/setup-python@v5
63-
# with:
64-
# cache: pip
65-
# python-version: '3.10'
66-
# - run: env | sort
67-
# - run: make dev
68-
# - run: make build
69-
# - env:
70-
# TWINE_USERNAME: __token__
71-
# TWINE_PASSWORD: ${{ secrets.PYPI_TOKEN }}
72-
# run: |
73-
# make upload
44+
make upload

pyproject.toml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,17 +20,16 @@ description = "Research & Development Agent"
2020
dynamic = [
2121
"dependencies",
2222
"optional-dependencies",
23+
"version",
2324
]
2425
keywords = [
2526
"Autonomous Agents",
2627
"Large Language Models",
2728
"Research and Development",
2829
]
29-
license = {text = "MIT License"}
3030
name = "rdagent"
3131
readme = "README.md"
3232
requires-python = ">=3.10"
33-
version = "v0.0.0"
3433

3534
[project.urls]
3635
homepage = "https://github.com/microsoft/RD-Agent/"
@@ -108,6 +107,8 @@ package = {file = ["requirements/package.txt"]}
108107
test = {file = ["requirements/test.txt"]}
109108

110109
[tool.setuptools_scm]
110+
local_scheme = "no-local-version"
111+
version_scheme = "guess-next-dev"
111112

112113
[tool.tomlsort]
113114
all = true

requirements/package.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,4 @@
22
build
33
setuptools-scm
44
twine
5+
wheel

0 commit comments

Comments
 (0)