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 <you-n-g@users.noreply.github.com>
This commit is contained in:
Linlang
2024-08-08 00:14:15 +08:00
committed by GitHub
parent 60e09c3a53
commit b2cf05a98c
6 changed files with 36 additions and 52 deletions
+12 -1
View File
@@ -1,4 +1,15 @@
<!--- 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:`. --> <!--- 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:`, `docs:`, `feat:`, `fix:`, `perf:`, `refactor:`, `revert:`, `style:`, `test:`(Ref: https://www.conventionalcommits.org/). -->
<!--- Category: -->
<!--- Patch Updates: `fix:` -->
<!--- Example: fix(auth): correct login validation issue -->
<!--- minor update (introduces new functionality): `feat` -->
<!--- Example: feature(parser): add ability to parse arrays -->
<!--- 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. -->
<!--- Example: feat(auth)! : remove support for old authentication method -->
<!--- Other updates: `build:`, `chore:`, `ci:`, `docs:`, `perf:`, `refactor:`, `revert:`, `style:`, `test:`. -->
## Description ## Description
<!--- Describe your changes in detail --> <!--- Describe your changes in detail -->
+1 -1
View File
@@ -7,7 +7,7 @@ jobs:
steps: steps:
- name: Check PR Title for Conventional Commit Format - name: Check PR Title for Conventional Commit Format
run: | run: |
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 if ! echo "${{ github.event.pull_request.title }}" | grep -Pq '^(build|chore|ci|docs|feat|fix|perf|refactor|revert|style|test)(\(\w+\))?!?:\s.*'; then
echo 'The title does not conform to the Conventional Commit.' echo 'The title does not conform to the Conventional Commit.'
echo 'Please refer to "https://www.conventionalcommits.org/"' echo 'Please refer to "https://www.conventionalcommits.org/"'
exit 1 exit 1
+18 -47
View File
@@ -23,51 +23,22 @@ jobs:
- name: Install dependencies - name: Install dependencies
run: | run: |
python -m pip install --upgrade pip python -m pip install --upgrade pip
pip install setuptools wheel twine bump2version git-changelog # better-exceptions(optional for debug) pip install setuptools wheel twine # better-exceptions(optional for debug)
- name: Bump version - name: Release please
run: | id: release_please
git config --global user.name 'github-actions[bot]' uses: googleapis/release-please-action@v4
git config --global user.email 'github-actions[bot]@users.noreply.github.com'
bump2version patch
NEW_VERSION=$(grep -Po '(?<=^version = ")[^"]*' pyproject.toml)
echo "new_version=$NEW_VERSION" >> $GITHUB_ENV
echo "New version: $NEW_VERSION"
- name: Push changes
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
echo "${{ secrets.PRIVATE_KEY }}" >> ~/private_key
chmod 600 ~/private_key
GIT_SSH_COMMAND="ssh -i ~/private_key" git push --follow-tags
- name: Generate changelog
run: |
make changelog
- name: Prepare release notes
run: make release-notes > release-notes.md
- name: Create GitHub release
uses: softprops/action-gh-release@v2
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with: with:
tag_name: ${{ env.new_version }} # The current PAT (personal access token) was created on 2024-08-05,
release_name: Release ${{ env.new_version }} # since the maximum validity of PAT is 1 year, you need to change the PAT before 2025-08-05.
body_path: release-notes.md token: ${{ secrets.PAT }}
prerelease: false release-type: simple
# package: - run: env | sort
# needs: release - run: make dev
# runs-on: ubuntu-latest - run: make build
# steps: - name: upload
# - uses: actions/checkout@v4 if: ${{ steps.release.outputs.release_created }}
# - name: Set up Python env:
# uses: actions/setup-python@v5 TWINE_USERNAME: __token__
# with: TWINE_PASSWORD: ${{ secrets.PYPI_TOKEN }}
# cache: pip run: |
# python-version: '3.10' make upload
# - run: env | sort
# - run: make dev
# - run: make build
# - env:
# TWINE_USERNAME: __token__
# TWINE_PASSWORD: ${{ secrets.PYPI_TOKEN }}
# run: |
# make upload
+3 -2
View File
@@ -20,17 +20,16 @@ description = "Research & Development Agent"
dynamic = [ dynamic = [
"dependencies", "dependencies",
"optional-dependencies", "optional-dependencies",
"version",
] ]
keywords = [ keywords = [
"Autonomous Agents", "Autonomous Agents",
"Large Language Models", "Large Language Models",
"Research and Development", "Research and Development",
] ]
license = {text = "MIT License"}
name = "rdagent" name = "rdagent"
readme = "README.md" readme = "README.md"
requires-python = ">=3.10" requires-python = ">=3.10"
version = "v0.0.0"
[project.urls] [project.urls]
homepage = "https://github.com/microsoft/RD-Agent/" homepage = "https://github.com/microsoft/RD-Agent/"
@@ -108,6 +107,8 @@ package = {file = ["requirements/package.txt"]}
test = {file = ["requirements/test.txt"]} test = {file = ["requirements/test.txt"]}
[tool.setuptools_scm] [tool.setuptools_scm]
local_scheme = "no-local-version"
version_scheme = "guess-next-dev"
[tool.tomlsort] [tool.tomlsort]
all = true all = true
+1
View File
@@ -2,3 +2,4 @@
build build
setuptools-scm setuptools-scm
twine twine
wheel