Skip to content

Commit

Permalink
Ko3n1g/ci/release automation (#10162)
Browse files Browse the repository at this point in the history
* create gh release

Signed-off-by: Oliver Koenig <okoenig@nvidia.com>

* dry run

Signed-off-by: Oliver Koenig <okoenig@nvidia.com>

---------

Signed-off-by: Oliver Koenig <okoenig@nvidia.com>
  • Loading branch information
ko3n1g authored Aug 15, 2024
1 parent 8870c61 commit cb58546
Showing 1 changed file with 26 additions and 26 deletions.
52 changes: 26 additions & 26 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,18 +28,18 @@ jobs:
VERSION=$(python -c "import nemo; print(nemo.__version__)")
NAME="NVIDIA Neural Modules ${VERSION}"
CHANGELOG=$(awk '/^## '$NAME'/{flag=1; next} /^## /{flag=0} flag' CHANGELOG.md)
CHANGELOG=$(echo "$CHANGELOG" | sed '/./!d')
CHANGELOG=$(awk '/^## '"$NAME"'/{flag=1; next} /^## /{flag=0} flag' CHANGELOG.md)
CHANGELOG=$(echo "$CHANGELOG" | sed '/./,$!d' | sed ':a;N;$!ba;s/\n$//')
PAYLOAD=$(jq \
-n \
-c \
--arg CI_COMMIT_BRANCH "$CI_COMMIT_BRANCH" \
--arg CI_COMMIT_BRANCH "${{ inputs.branch }}" \
--arg NAME "$NAME" \
--arg BODY "$CHANGELOG" \
'{
"tag_name": $CI_COMMIT_BRANCH,
"target_commitish": $CI_COMMIT_BRANCH,
"tag_name": ${{ inputs.branch }},
"target_commitish": ${{ inputs.branch }},
"name": $NAME,
"body": $BODY,
"draft": false,
Expand All @@ -51,36 +51,36 @@ jobs:
echo curl -L \
-X POST \
-H "Accept: application/vnd.github+json" \
-H "Authorization: Bearer $GH_TOKEN" \
-H "Authorization: Bearer ${{ secrets.PAT }}" \
-H "X-GitHub-Api-Version: 2022-11-28" \
https://api.github.com/repos/NVIDIA/NeMo/releases \
-d $PAYLOAD
# - name: Build, test, and release wheel
# env:
# TWINE_USERNAME: ${{ secrets.TWINE_USERNAME }}
# TWINE_PASSWORD: ${{ secrets.TWINE_PASSWORD }}
# run: |
# cd ${{ github.run_id }}
# python3 -m pip install --upgrade build
# python3 -m build
- name: Build, test, and release wheel
env:
TWINE_USERNAME: ${{ secrets.TWINE_USERNAME }}
TWINE_PASSWORD: ${{ secrets.TWINE_PASSWORD }}
run: |
cd ${{ github.run_id }}
python3 -m pip install --upgrade build
python3 -m build
# pip install dist/*.whl
pip install dist/*.whl
# cd ../
cd ../
# INSTALLED_VERSION=$(python -c 'import nemo; print(nemo.__version__)')
# EXPECTED_VERSION=${{ steps.version-number.outputs.VERSION }}
INSTALLED_VERSION=$(python -c 'import nemo; print(nemo.__version__)')
EXPECTED_VERSION=${{ steps.version-number.outputs.VERSION }}
# if [[ "$INSTALLED_VERSION" != "$EXPECTED_VERSION" ]]; then
# echo 'Wheel has an outdated version, mission abort immediately!'
# exit 1
# fi
if [[ "$INSTALLED_VERSION" != "$EXPECTED_VERSION" ]]; then
echo 'Wheel has an outdated version, mission abort immediately!'
exit 1
fi
# echo Proceed with uploading wheel...
# cd ${{ github.run_id }}
# python3 -m pip install --upgrade twine
# python3 -m twine upload --repository pypi dist/*
echo Proceed with uploading wheel...
cd ${{ github.run_id }}
python3 -m pip install --upgrade twine
echo Spython3 -m twine upload --repository pypi dist/*
# - name: notify
# run: |
Expand Down

0 comments on commit cb58546

Please sign in to comment.