Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Automate CI/CD Workflow] #89

Merged
merged 75 commits into from
Jul 16, 2024
Merged
Show file tree
Hide file tree
Changes from 16 commits
Commits
Show all changes
75 commits
Select commit Hold shift + click to select a range
a48299a
Merge pull request #87 from SylphAI-Inc/main
Sylph-AI Jul 6, 2024
8cf087a
automate the publish release
Alleria1809 Jul 7, 2024
9446b5d
Merge remote-tracking branch 'origin/main' into release
Alleria1809 Jul 7, 2024
b82e4c1
Merge remote-tracking branch 'origin/release' into release
Alleria1809 Jul 7, 2024
84c2c67
release version test
Alleria1809 Jul 7, 2024
b3dbfa6
release version test
Alleria1809 Jul 7, 2024
6f1ea07
release version test workflow
Alleria1809 Jul 7, 2024
83e7830
sync toml file with release version
Alleria1809 Jul 7, 2024
3c4f399
sync toml file with release version
Alleria1809 Jul 7, 2024
ff2e624
sync toml file with release version
Alleria1809 Jul 7, 2024
bc6e051
test version release
Alleria1809 Jul 7, 2024
2685704
test version release
Alleria1809 Jul 7, 2024
c594c21
test version release
Alleria1809 Jul 7, 2024
fa83a79
fix errors of the workflow
Alleria1809 Jul 7, 2024
d09b2c5
reset the version back to original after testing
Alleria1809 Jul 7, 2024
dbc6257
hide the test publish yaml
Alleria1809 Jul 7, 2024
93437c0
update the automate release workflow, adding test and rollbacks
Alleria1809 Jul 8, 2024
55e4993
validate if the pr is a tag
Alleria1809 Jul 8, 2024
e825ed7
test version release
Alleria1809 Jul 8, 2024
cc6ffc6
test version release
Alleria1809 Jul 8, 2024
9142e2a
test version release
Alleria1809 Jul 8, 2024
8b65130
reset the version back to original after testing
Alleria1809 Jul 8, 2024
554efbf
test version release
Alleria1809 Jul 8, 2024
69426e0
update the tag
Alleria1809 Jul 8, 2024
93ebb8a
update the tag
Alleria1809 Jul 8, 2024
20c592e
update the toml version
Alleria1809 Jul 8, 2024
9eb1103
update the toml version
Alleria1809 Jul 8, 2024
27b65f8
test version release
Alleria1809 Jul 8, 2024
e6ee32d
test version release
Alleria1809 Jul 8, 2024
a173d7c
test version release
Alleria1809 Jul 8, 2024
614d91d
update the version control guide
Alleria1809 Jul 8, 2024
9d964a9
update the version control guide
Alleria1809 Jul 9, 2024
67231dc
reset the version back to original after testing
Alleria1809 Jul 9, 2024
fcd531e
update the instruction
Alleria1809 Jul 9, 2024
cd066dc
Rebase on main
liyin2015 Jul 9, 2024
14ceef1
update the tutorial
Alleria1809 Jul 9, 2024
2a68d6a
add tokenization example
Alleria1809 Jul 9, 2024
7e819df
update tutorial
Alleria1809 Jul 9, 2024
bb70a9d
update tutorial
Alleria1809 Jul 9, 2024
8defe13
Merge branch 'release' of https://github.com/SylphAI-Inc/LightRAG int…
Alleria1809 Jul 9, 2024
50600d2
sync tutorial
Alleria1809 Jul 9, 2024
f5a6a20
Merge pull request #99 from SylphAI-Inc/main
Sylph-AI Jul 9, 2024
21f9b42
remove unnecessary doc
Alleria1809 Jul 10, 2024
ee314b1
update the contribution guide
Alleria1809 Jul 10, 2024
fbdcd1c
update text splitter
Alleria1809 Jul 10, 2024
6f5b17b
update contribution guide
Alleria1809 Jul 10, 2024
e8c5cb1
update contribution guide
Alleria1809 Jul 10, 2024
80f607c
update the download dashboard link
Alleria1809 Jul 11, 2024
85d859e
hide the version control
Alleria1809 Jul 11, 2024
1911ee2
update the contribution guide
Alleria1809 Jul 11, 2024
1d0ffe3
Merge remote-tracking branch 'origin/main' into release
Alleria1809 Jul 11, 2024
1049549
temporarily hide the contributor
Alleria1809 Jul 11, 2024
682e66a
Merge pull request #105 from SylphAI-Inc/main
Sylph-AI Jul 11, 2024
97d7084
test the deployment
Alleria1809 Jul 12, 2024
be71a38
Merge remote-tracking branch 'origin/release' into release
Alleria1809 Jul 12, 2024
4697b57
update python version
Alleria1809 Jul 12, 2024
354dd53
update python version
Alleria1809 Jul 12, 2024
ef3cb0f
update release deployment test
Alleria1809 Jul 12, 2024
68535d4
update release deployment test
Alleria1809 Jul 12, 2024
9f330ae
update release deployment test
Alleria1809 Jul 12, 2024
0bd4e61
reset toml
Alleria1809 Jul 12, 2024
7feef6a
update workflow
Alleria1809 Jul 12, 2024
68ffcbb
update workflow
Alleria1809 Jul 12, 2024
13aad73
update workflow and set 3.10 aside
Alleria1809 Jul 12, 2024
41b0c84
update workflow test
Alleria1809 Jul 12, 2024
684e6a5
address conflicts to main
liyin2015 Jul 12, 2024
fdcf692
Merge pull request #111 from SylphAI-Inc/main
liyin2015 Jul 12, 2024
f50b9b6
update workflow test
Alleria1809 Jul 12, 2024
dc28ef6
Merge remote-tracking branch 'origin/main' into release
Alleria1809 Jul 12, 2024
cb191eb
Merge remote-tracking branch 'origin/release' into release
Alleria1809 Jul 12, 2024
3f5f001
update workflow test
Alleria1809 Jul 12, 2024
8eeb734
update workflow test
Alleria1809 Jul 12, 2024
e2f2c43
update version
Alleria1809 Jul 12, 2024
01fb78c
version update
Alleria1809 Jul 12, 2024
aaa09fb
rebase on main
liyin2015 Jul 15, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
89 changes: 89 additions & 0 deletions .github/workflows/publish_release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
name: Publish the latest release on PyPI

on:
Copy link
Member

@liyin2015 liyin2015 Jul 8, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lets trigger on pr merge on release that we have to sort it out

on:
  pull_request:
    types: [closed]
    branches:
      - main

and there is also stable and not stable release

Copy link
Contributor Author

@Alleria1809 Alleria1809 Jul 8, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah I considered this, setting it to trigger on PRs that have a tag is more flexible and will be the future workflow. Setting it to main is more of centralized control for now.

I'd check more about stable and not stable release. I currently refer to llamaindex, langchain, etc.

push:
tags:
- 'v*'
branches:
- main # Restricts the workflow to only run on tags pushed to the main branch

jobs:
validate-tag:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Validate Tag Format
run: |
TAG_REGEX='^v[0-9]+\.[0-9]+\.[0-9]+(-[a-zA-Z0-9\-\.]+)?$'
echo "Regex to match: $TAG_REGEX"
TAG="${GITHUB_REF/refs\/tags\//}"
echo "Tag extracted: $TAG"
if [[ "$TAG" =~ $TAG_REGEX ]]; then
echo "Tag format is valid."
else
echo "::error::Tag $TAG does not match the 'vMAJOR.MINOR.PATCH' or 'vMAJOR.MINOR.PATCH-pre-release' format."
exit 1
fi
shell: bash

build-and-package:
needs: validate-tag
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.11'
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

also here we should use poetry install --no-dev

And we can make sure all tests are run successfully before the build and publish as another safety

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is a kind of dry publish. I used it in a test file, it works. So we can also add that simulation test before publish

- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install poetry
poetry install

# Comment out the pytest step
# - name: Run tests
# run: |
# poetry run pytest

- name: Build the distribution
run: poetry build

publish-to-pypi:
needs: build-and-package
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.11'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks like overlap and repeating previous steps, not sure this is what you have designed on the workflow

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is just a duplication. I will remove this.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

its stil repeating, im not sure why this has to be separate from the first,

pip install poetry
- name: Build the distribution
run: poetry build
- name: Publish
uses: pypa/[email protected]
with:
user: __token__
password: ${{ secrets.PYPI_KEY }}
build: true # Ensure the distribution is built before publishing

create-github-release:
needs: publish-to-pypi
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Create Release on GitHub
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.ref_name }}
release_name: Release ${{ github.ref_name }}
body: 'Automated release of version ${{ github.ref_name }}'
draft: false
prerelease: false
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -53,4 +53,4 @@ lightrag = { path = "lightrag", develop = true }

[build-system]
requires = ["poetry-core>=1.0.0"]
build-backend = "poetry.core.masonry.api"
build-backend = "poetry.core.masonry.api"
Loading