-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
SK-1731: Updated workflows for internal release
- Loading branch information
1 parent
704f48e
commit 2bec984
Showing
11 changed files
with
198 additions
and
134 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
# .github/workflows/beta-release.yml | ||
name: Public Beta Release | ||
|
||
on: | ||
push: | ||
tags: '*.*.*b*' | ||
paths-ignore: | ||
- "setup.py" | ||
- "*.yml" | ||
- "*.md" | ||
- "skyflow/utils/_version.py" | ||
|
||
jobs: | ||
build-and-deploy: | ||
uses: ./shared-build-and-deploy.yml | ||
with: | ||
ref: main | ||
pypi-token: ${{ secrets.PYPI_PUBLISH_TOKEN }} | ||
is-internal: false |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -16,46 +16,8 @@ jobs: | |
checkAllCommitMessages: 'true' | ||
accessToken: ${{ secrets.PAT_ACTIONS }} | ||
error: 'One of your your commit messages is not matching the format with JIRA ID Ex: ( SDK-123 commit message )' | ||
Test: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- uses: actions/setup-python@v2 | ||
with: | ||
python-version: '3.7' | ||
|
||
- name: create-json | ||
id: create-json | ||
uses: jsdaniell/[email protected] | ||
with: | ||
name: "credentials.json" | ||
json: ${{ secrets.CREDENTIALS_FILE_STR }} | ||
|
||
- name: 'Setup .env' | ||
run: | | ||
touch .env | ||
echo VAULT_ID=${{secrets.VAULT_ID}} >> .env | ||
echo VAULT_URL=${{secrets.VAULT_URL}} >> .env | ||
echo DETOKENIZE_TEST_TOKEN=${{secrets.DETOKENIZE_TEST_TOKEN}} >> .env | ||
echo DETOKENIZE_TEST_VALUE=${{secrets.DETOKENIZE_TEST_VALUE}} >> .env | ||
echo CREDENTIALS_FILE_PATH=./credentials.json >> .env | ||
echo CVV_GEN_CONNECTION_URL=${{secrets.CVV_GEN_CONNECTION_URL}} >> .env | ||
echo VISA_CONNECTION_BASIC_AUTH=${{secrets.VISA_CONNECTION_BASIC_AUTH}} >> .env | ||
echo SKYFLOW_ID1=${{secrets.SKYFLOW_ID1}} >> .env | ||
echo SKYFLOW_ID2=${{secrets.SKYFLOW_ID2}} >> .env | ||
echo SKYFLOW_ID3=${{secrets.SKYFLOW_ID3}} >> .env | ||
|
||
- name: 'Run Tests' | ||
run: | | ||
python -m pip install --upgrade pip | ||
pip install requests pyjwt datetime aiohttp cryptography python-dotenv coverage | ||
coverage run --source skyflow -m unittest discover | ||
- name: coverage | ||
run: coverage xml -o test-coverage.xml | ||
- name: Codecov | ||
uses: codecov/[email protected] | ||
with: | ||
token: ${{ secrets.CODECOV_REPO_UPLOAD_TOKEN }} | ||
files: test-coverage.xml | ||
name: codecov-skyflow-python | ||
verbose: true | ||
test: | ||
uses: ./shared-tests.yml | ||
with: | ||
python-version: '3.7' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
name: Internal Release | ||
|
||
on: | ||
push: | ||
tags-ignore: | ||
- '*.*' | ||
paths-ignore: | ||
- "setup.py" | ||
- "*.yml" | ||
- "*.md" | ||
- "skyflow/utils/_version.py" | ||
branches: | ||
- release/* | ||
|
||
jobs: | ||
build-and-deploy: | ||
uses: ./shared-build-and-deploy.yml | ||
with: | ||
ref: ${{ github.ref_name }} | ||
artifactory-username: ${{ secrets.JFROG_USERNAME }} | ||
artifactory-password: ${{ secrets.JFROG_PASSWORD }} | ||
is-internal: true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,46 +6,7 @@ on: | |
- main | ||
|
||
jobs: | ||
Test: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- uses: actions/setup-python@v2 | ||
with: | ||
python-version: '3.7' | ||
|
||
- name: create-json | ||
id: create-json | ||
uses: jsdaniell/[email protected] | ||
with: | ||
name: "credentials.json" | ||
json: ${{ secrets.CREDENTIALS_FILE_STR }} | ||
|
||
- name: 'Setup .env' | ||
run: | | ||
touch .env | ||
echo VAULT_ID=${{secrets.VAULT_ID}} >> .env | ||
echo VAULT_URL=${{secrets.VAULT_URL}} >> .env | ||
echo DETOKENIZE_TEST_TOKEN=${{secrets.DETOKENIZE_TEST_TOKEN}} >> .env | ||
echo DETOKENIZE_TEST_VALUE=${{secrets.DETOKENIZE_TEST_VALUE}} >> .env | ||
echo CREDENTIALS_FILE_PATH=./credentials.json >> .env | ||
echo CVV_GEN_CONNECTION_URL=${{secrets.CVV_GEN_CONNECTION_URL}} >> .env | ||
echo VISA_CONNECTION_BASIC_AUTH=${{secrets.VISA_CONNECTION_BASIC_AUTH}} >> .env | ||
echo SKYFLOW_ID1=${{secrets.SKYFLOW_ID1}} >> .env | ||
echo SKYFLOW_ID2=${{secrets.SKYFLOW_ID2}} >> .env | ||
echo SKYFLOW_ID3=${{secrets.SKYFLOW_ID3}} >> .env | ||
- name: 'Run Tests' | ||
run: | | ||
python -m pip install --upgrade pip | ||
pip install requests pyjwt datetime aiohttp cryptography python-dotenv coverage | ||
coverage run --source skyflow -m unittest discover | ||
- name: coverage | ||
run: coverage xml -o test-coverage.xml | ||
- name: Codecov | ||
uses: codecov/[email protected] | ||
with: | ||
token: ${{ secrets.CODECOV_REPO_UPLOAD_TOKEN }} | ||
files: test-coverage.xml | ||
name: codecov-skyflow-python | ||
verbose: true | ||
test: | ||
uses: ./shared-tests.yml | ||
with: | ||
python-version: '3.7' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,90 @@ | ||
name: Shared Build and Deploy | ||
|
||
on: | ||
workflow_call: | ||
inputs: | ||
ref: | ||
description: 'Git reference to use (e.g., main or branch name)' | ||
required: true | ||
type: string | ||
pypi-token: | ||
description: 'PyPI token for publishing' | ||
required: false | ||
type: string | ||
artifactory-username: | ||
description: 'Artifactory username for internal release' | ||
required: false | ||
type: string | ||
artifactory-password: | ||
description: 'Artifactory password for internal release' | ||
required: false | ||
type: string | ||
is-internal: | ||
description: 'Flag for internal release' | ||
required: true | ||
type: boolean | ||
|
||
jobs: | ||
build-and-deploy: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
with: | ||
token: ${{ secrets.PAT_ACTIONS }} | ||
ref: ${{ inputs.ref }} | ||
fetch-depth: 0 | ||
|
||
- uses: actions/setup-python@v2 | ||
|
||
- name: Install dependencies | ||
run: | | ||
python -m pip install --upgrade pip | ||
pip install setuptools wheel twine | ||
- name: Get Previous tag | ||
id: previoustag | ||
uses: WyriHaximus/github-action-get-previous-tag@v1 | ||
with: | ||
fallback: 1.0.0 | ||
|
||
- name: Bump Version | ||
run: | | ||
chmod +x ./ci-scripts/bump_version.sh | ||
if ${{ inputs.is-internal }}; then | ||
./ci-scripts/bump_version.sh "${{ steps.previoustag.outputs.tag }}" "$(git rev-parse --short "$GITHUB_SHA")" | ||
else | ||
./ci-scripts/bump_version.sh "${{ steps.previoustag.outputs.tag }}" | ||
fi | ||
- name: Commit changes | ||
run: | | ||
git config user.name ${{ github.actor }} | ||
git config user.email ${{ github.actor }}@users.noreply.github.com | ||
git add setup.py | ||
git add skyflow/version.py | ||
if ${{ inputs.is-internal }}; then | ||
git commit -m "[AUTOMATED] Private Release ${{ steps.previoustag.outputs.tag }}-dev+$(git rev-parse --short $GITHUB_SHA)" | ||
git push origin ${{ github.ref_name }} -f | ||
else | ||
git commit -m "[AUTOMATED] Public Release - ${{ steps.previoustag.outputs.tag }}" | ||
git push origin | ||
- name: Build the package | ||
run: | | ||
python setup.py sdist bdist_wheel | ||
- name: Publish Package | ||
if: ${{ !inputs.is-internal }} | ||
env: | ||
TWINE_USERNAME: __token__ | ||
TWINE_PASSWORD: ${{ inputs.pypi-token }} | ||
run: | | ||
twine upload dist/* | ||
- name: Publish to JFrog Artifactory | ||
if: ${{ inputs.is-internal }} | ||
env: | ||
TWINE_USERNAME: ${{ inputs.artifactory-username }} | ||
TWINE_PASSWORD: ${{ inputs.artifactory-password }} | ||
run: | | ||
twine upload --repository-url https://prekarilabs.jfrog.io/artifactory/api/pypi/skyflow-python/ dist/* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
name: Shared Test Steps | ||
|
||
on: | ||
workflow_call: | ||
inputs: | ||
python-version: | ||
description: 'Python version to use' | ||
required: true | ||
type: string | ||
|
||
jobs: | ||
run-tests: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- uses: actions/setup-python@v2 | ||
with: | ||
python-version: ${{ inputs.python-version }} | ||
|
||
- name: 'Run Tests' | ||
run: | | ||
pip install -r requirements.txt | ||
python -m coverage run --source=skyflow --omit=skyflow/generated/*,skyflow/utils/validations/*,skyflow/vault/data/*,skyflow/vault/tokens/*,skyflow/vault/connection/*,skyflow/error/*,skyflow/utils/enums/*,skyflow/vault/controller/_audit.py,skyflow/vault/controller/_bin_look_up.py -m unittest discover | ||
- name: coverage | ||
run: coverage xml -o test-coverage.xml | ||
|
||
- name: Codecov | ||
uses: codecov/[email protected] | ||
with: | ||
token: ${{ secrets.CODECOV_REPO_UPLOAD_TOKEN }} | ||
files: test-coverage.xml | ||
name: codecov-skyflow-python | ||
verbose: true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
python_dateutil >= 2.5.3 | ||
setuptools >= 21.0.0 | ||
urllib3 >= 1.25.3, < 2.1.0 | ||
pydantic >= 2 | ||
typing-extensions >= 4.7.1 | ||
DateTime~=5.5 | ||
PyJWT~=2.9.0 | ||
requests~=2.32.3 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters