diff --git a/.github/workflows/build_and_test.yml b/.github/workflows/build_and_test.yml index f357701..2de4600 100644 --- a/.github/workflows/build_and_test.yml +++ b/.github/workflows/build_and_test.yml @@ -10,8 +10,27 @@ on: branches: [ main ] types: [ opened, synchronize, reopened ] + # Allows you to run this workflow manually from the Actions tab + workflow_dispatch: + +env: + TWINE_USERNAME: __token__ + TWINE_PASSWORD: ${{ secrets.PYPI_API_TOKEN }} + jobs: + setup: + runs-on: ubuntu-latest + outputs: + is_release_build: ${{ env.RELEASE_BUILD == '1' }} + steps: + - name: Check for release build + if: startsWith(github.ref, 'refs/tags/') + run: | + echo "Build release for $GITHUB_REF" + echo "RELEASE_BUILD=1" >> $GITHUB_ENV + build: + needs: setup runs-on: ubuntu-latest if: | @@ -40,7 +59,22 @@ jobs: name: pypylon-contrib-wheel path: dist/*.whl + - name: Upload Release Asset + if: needs.setup.outputs.is_release_build == 'true' + uses: softprops/action-gh-release@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + files: dist/* + + - name: Publish package to PyPI + if: needs.setup.outputs.is_release_build == 'true' && startsWith( matrix.p, 'manylinux' ) + run: | + sudo pip3 install twine + python3 -m twine upload --non-interactive --skip-existing dist/* + test: + needs: setup runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 @@ -60,7 +94,7 @@ jobs: pytest tests lint: - + needs: setup runs-on: ubuntu-latest strategy: matrix: diff --git a/README.md b/README.md index 021bebf..3537a09 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -![pypylon](https://github.com/basler/pypylon-samples/blob/a22ab135a34e815fdde3ef3431b868617de6f712/docs/images/Pypylon_grey_RZ_400px.png "pypylon") +![pypylon](https://raw.githubusercontent.com/basler/pypylon-samples/a22ab135a34e815fdde3ef3431b868617de6f712/docs/images/Pypylon_grey_RZ_400px.png "pypylon") Sample applications and jupyter notebooks using the official python wrapper for the Basler pylon Camera Software Suite. diff --git a/changelog.txt b/changelog.txt new file mode 100644 index 0000000..6eb55a8 --- /dev/null +++ b/changelog.txt @@ -0,0 +1,8 @@ +Version 0.1.1rc1 + - Date 2025-09-15 + - Added CI and changelog, initial release on PyPI + - Update README.md + +Version 0.1.0 + - Date 2025-08-25 + - Initial release