diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md index d8dee06c..d2da1456 100644 --- a/.github/PULL_REQUEST_TEMPLATE.md +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -1,4 +1,15 @@ - + + + + + + + + + + + + ## Description diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index d77ad178..1f0a775c 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -67,4 +67,4 @@ on: - synchronize push: branches: - - main + - main \ No newline at end of file diff --git a/.github/workflows/pr.yml b/.github/workflows/pr.yml index 7a1d109f..0f4618a5 100644 --- a/.github/workflows/pr.yml +++ b/.github/workflows/pr.yml @@ -7,7 +7,7 @@ jobs: steps: - name: Check PR Title for Conventional Commit Format 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 'Please refer to "https://www.conventionalcommits.org/"' exit 1 diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 9a27fab1..ad9d9e20 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -23,51 +23,22 @@ jobs: - name: Install dependencies run: | python -m pip install --upgrade pip - pip install setuptools wheel twine bump2version git-changelog # better-exceptions(optional for debug) - - name: Bump version - run: | - git config --global user.name 'github-actions[bot]' - 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 }} + pip install setuptools wheel twine # better-exceptions(optional for debug) + - name: Release please + id: release_please + uses: googleapis/release-please-action@v4 with: - tag_name: ${{ env.new_version }} - release_name: Release ${{ env.new_version }} - body_path: release-notes.md - prerelease: false - # package: - # needs: release - # runs-on: ubuntu-latest - # steps: - # - uses: actions/checkout@v4 - # - name: Set up Python - # uses: actions/setup-python@v5 - # with: - # cache: pip - # python-version: '3.10' - # - run: env | sort - # - run: make dev - # - run: make build - # - env: - # TWINE_USERNAME: __token__ - # TWINE_PASSWORD: ${{ secrets.PYPI_TOKEN }} - # run: | - # make upload + # The current PAT (personal access token) was created on 2024-08-05, + # since the maximum validity of PAT is 1 year, you need to change the PAT before 2025-08-05. + token: ${{ secrets.PAT }} + release-type: simple + - run: env | sort + - run: make dev + - run: make build + - name: upload + if: ${{ steps.release.outputs.release_created }} + env: + TWINE_USERNAME: __token__ + TWINE_PASSWORD: ${{ secrets.PYPI_TOKEN }} + run: | + make upload diff --git a/pyproject.toml b/pyproject.toml index 0a9c8e1f..e2bf5d2c 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -20,17 +20,16 @@ description = "Research & Development Agent" dynamic = [ "dependencies", "optional-dependencies", + "version", ] keywords = [ "Autonomous Agents", "Large Language Models", "Research and Development", ] -license = {text = "MIT License"} name = "rdagent" readme = "README.md" requires-python = ">=3.10" -version = "v0.0.0" [project.urls] homepage = "https://github.com/microsoft/RD-Agent/" @@ -108,6 +107,8 @@ package = {file = ["requirements/package.txt"]} test = {file = ["requirements/test.txt"]} [tool.setuptools_scm] +local_scheme = "no-local-version" +version_scheme = "guess-next-dev" [tool.tomlsort] all = true diff --git a/requirements/package.txt b/requirements/package.txt index 0918c6ba..2ec4324b 100644 --- a/requirements/package.txt +++ b/requirements/package.txt @@ -2,3 +2,4 @@ build setuptools-scm twine +wheel