77 description : ' Git reference to use (e.g., main or branch name)'
88 required : true
99 type : string
10-
11- is-internal :
12- description : ' Flag for internal release '
10+
11+ tag :
12+ description : ' Release Tag '
1313 required : true
14- type : boolean
14+ type : string
1515
1616jobs :
1717 build-and-deploy :
1818 runs-on : ubuntu-latest
1919 steps :
20- - name : checkout branch
20+ - uses : actions/ checkout@v2
2121 with :
2222 fetch-depth : 0
23- uses : actions/checkout@v1
24- - name : Get Branch
25- run : |
26- BRANCH_NAME=$(git branch -r --contains ${{ github.sha }} | grep -o 'origin/.*' | sed 's|origin/||' | head -n 1)
27- echo "Branch Name: $BRANCH_NAME"
28- echo "branch_name=$BRANCH_NAME" >> $GITHUB_ENV
29- git checkout $branch_name
3023
3124 - uses : actions/setup-python@v2
3225 - name : Install dependencies
@@ -43,28 +36,46 @@ jobs:
4336 - name : Bump Version
4437 run : |
4538 chmod +x ./ci-scripts/bump_version.sh
46- if ${{ inputs.is- internal }}; then
39+ if ${{ inputs.tag == ' internal' }}; then
4740 ./ci-scripts/bump_version.sh "${{ steps.previoustag.outputs.tag }}" "$(git rev-parse --short "$GITHUB_SHA")"
4841 else
4942 ./ci-scripts/bump_version.sh "${{ steps.previoustag.outputs.tag }}"
5043 fi
5144
5245 - name : Commit changes
46+ if : ${{ inputs.tag == 'internal' || inputs.tag == 'public' }}
5347 run : |
5448 git config user.name "${{ github.actor }}"
5549 git config user.email "${{ github.actor }}@users.noreply.github.com"
5650 git add setup.py
5751 git add skyflow/utils/_version.py
5852
59- if [ "${{ inputs.is-internal }}" = "true " ]; then
53+ if [ "${{ inputs.tag }}" = "internal " ]; then
6054 VERSION="${{ steps.previoustag.outputs.tag }}.dev0+$(git rev-parse --short $GITHUB_SHA)"
6155 COMMIT_MESSAGE="[AUTOMATED] Private Release $VERSION"
6256 git commit -m "$COMMIT_MESSAGE"
6357 git push origin ${{ github.ref_name }} -f
64- else
58+ fi
59+ if [ "${{ inputs.tag }}" = "public" ]; then
6560 COMMIT_MESSAGE="[AUTOMATED] Public Release - ${{ steps.previoustag.outputs.tag }}"
6661 git commit -m "$COMMIT_MESSAGE"
67- git push origin HEAD:refs/heads/${{ env.branch_name }} -f
68-
62+ git push origin
6963 fi
70-
64+
65+ - name : Build and Publish Package
66+ if : ${{ inputs.tag == 'beta' || inputs.tag == 'public' }}
67+ env :
68+ TWINE_USERNAME : __token__
69+ TWINE_PASSWORD : ${{ secrets.PYPI_PUBLISH_TOKEN }}
70+ run : |
71+ python setup.py sdist bdist_wheel
72+ twine upload dist/*
73+
74+ - name : Build and Publish to JFrog Artifactory
75+ if : ${{ inputs.tag == 'internal' }}
76+ env :
77+ TWINE_USERNAME : ${{ secrets.JFROG_USERNAME }}
78+ TWINE_PASSWORD : ${{ secrets.JFROG_PASSWORD }}
79+ run : |
80+ python setup.py sdist bdist_wheel
81+ twine upload --repository-url https://prekarilabs.jfrog.io/artifactory/api/pypi/skyflow-python/ dist/*
0 commit comments