Skip to content

Commit

Permalink
Improved createReleasePIP action
Browse files Browse the repository at this point in the history
- removed dependency from build.sh file
  • Loading branch information
mkcn committed Jan 16, 2022
1 parent 998a1e2 commit 2196480
Showing 1 changed file with 26 additions and 42 deletions.
68 changes: 26 additions & 42 deletions .github/workflows/createReleasePIP.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
name: Create release PIP

# triggered manually or if file version changes
on:
workflow_dispatch:
push:
Expand All @@ -21,75 +20,60 @@ jobs:
- name: Get release version from version file
run: |
echo "FH_RELEASE_VERSION=$(cat $GITHUB_WORKSPACE/fastHistory/config/default_version.txt)" >> $GITHUB_ENV
- name: Show version
run: echo ${{ env.FH_RELEASE_VERSION }}
echo ${{ env.FH_RELEASE_VERSION }}
- name: Setup env
- name: Setup build env
run: |
python3 --version
pip3 --version
cd $GITHUB_WORKSPACE/pip/
# TODO improve this
# first run -> create env
./build.sh <<< "N"
pip3 install setuptools
pip3 install wheel
pip3 install twine
pip3 install bashlex
pip3 install pyperclip
- name: Run pip builder, install local whl and uninstall it
- name: Build whl package
run: |
cd $GITHUB_WORKSPACE/pip/
# second run -> build pip package
./build.sh <<< "N"
cd $HOME
# install pip package
pip3 install --user --no-deps $GITHUB_WORKSPACE/pip/dist/fastHistory-*.whl
# setup environment
python3 setup.py bdist_wheel
- name: Test installation from whl package
run: |
pip3 install --user --no-deps --ignore-installed $GITHUB_WORKSPACE/pip/dist/fastHistory-*.whl
$HOME/.local/bin/f --setup
$HOME/.local/bin/f --version --from-installer
echo "FH_WHL_VERSION=$($HOME/.local/bin/f --version --from-installer)" >> $GITHUB_ENV
echo ${{ env.FH_WHL_VERSION }}
$GITHUB_WORKSPACE/installer.sh -u --yes-delete-everything
- name: Check version matching
if: ${{ env.FH_WHL_VERSION }} != ${{ env.FH_RELEASE_VERSION }}
run: |
echo "Error: something is wrong, the whl package and the repo have different versions"
exit 1
- name: deploy on test.pypi.org
- name: Deploy on test.pypi.org
run: |
cd $GITHUB_WORKSPACE/pip/
# TODO remove source
source build-env/bin/activate
# TODO new secrets
python3 -m twine upload -u __token__ -p ${{ secrets.TEST_PYPI_API_TOKEN }} --repository-url "https://test.pypi.org/legacy/" dist/*.whl
- name: Install it from test.pypi.org
- name: Test installation from test.pypi.org
run: |
# bashlex is not present in the test pypi, therefore it must installed separately
# bashlex is not present in the test pypi, therefore it needs "--no-deps"
pip3 install --user --index-url https://test.pypi.org/simple/ --no-deps fastHistory
# setup environment
$HOME/.local/bin/f --setup
$HOME/.local/bin/f --version --from-installer
$GITHUB_WORKSPACE/installer.sh -u --yes-delete-everything
- name: deploy on pypi.org
- name: Deploy on pypi.org
run: |
cd $GITHUB_WORKSPACE/pip/
# TODO remove source
source build-env/bin/activate
python3 -m twine upload -u __token__ -p ${{ secrets.PYPI_API_TOKEN }} dist/*.whl
- name: Install it from pypi.org
- name: Test installation from pypi.org
run: |
pip3 install --user fastHistory
# setup environment
$HOME/.local/bin/f --setup
$HOME/.local/bin/f --version --from-installer
$GITHUB_WORKSPACE/installer.sh -u --yes-delete-everything
# TODO make rollback procedure if fails

0 comments on commit 2196480

Please sign in to comment.