Skip to content

Commit 41b1c8c

Browse files
SK-1772: Refactored workflows
1 parent 718e08d commit 41b1c8c

File tree

6 files changed

+34
-23
lines changed

6 files changed

+34
-23
lines changed

.github/workflows/beta-release.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,5 +14,5 @@ jobs:
1414
uses: ./.github/workflows/shared-build-and-deploy.yml
1515
with:
1616
ref: ${{ github.ref_name }}
17-
is-internal: false
17+
tag: 'beta'
1818
secrets: inherit

.github/workflows/internal-release.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,6 @@ jobs:
1818
uses: ./.github/workflows/shared-build-and-deploy.yml
1919
with:
2020
ref: ${{ github.ref_name }}
21-
is-internal: true
21+
tag: 'internal'
2222
secrets: inherit
2323

.github/workflows/release.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,5 +14,5 @@ jobs:
1414
uses: ./.github/workflows/shared-build-and-deploy.yml
1515
with:
1616
ref: main
17-
is-internal: false
17+
tag: 'public'
1818
secrets: inherit

.github/workflows/shared-build-and-deploy.yml

Lines changed: 29 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -7,26 +7,19 @@ on:
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

1616
jobs:
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/*

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77

88
if sys.version_info < (3, 8):
99
raise RuntimeError("skyflow requires Python 3.8+")
10-
current_version = '1.15.1.dev0+9eff324'
10+
current_version = '2.0.0b1'
1111

1212
setup(
1313
name='skyflow',

skyflow/utils/_version.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
SDK_VERSION = '1.15.1.dev0+9eff324'
1+
SDK_VERSION = '2.0.0b1'

0 commit comments

Comments
 (0)