diff --git a/.github/workflows/build-and-release.yml b/.github/workflows/build-and-release.yml index 3d9e7b0..cc106c7 100644 --- a/.github/workflows/build-and-release.yml +++ b/.github/workflows/build-and-release.yml @@ -3,6 +3,8 @@ name: Build and release on: push: branches: [master] + tags-ignore: + - '*' pull_request: branches: [master] @@ -33,3 +35,80 @@ jobs: - name: Run tests run: | ./run-tests.sh + + bump: + needs: test + if: ${{ github.event_name == 'push' }} + runs-on: ubuntu-latest + steps: + - name: Check out the repository + uses: actions/checkout@v2 + with: + fetch-depth: 0 + token: ${{ secrets.PAT_RELEASE_PACKAGES }} + + - name: Set up Python + uses: actions/setup-python@v4 + with: + python-version: 3.8 + + - name: Install bump2version + shell: bash + run: | + python -m pip install --upgrade pip + pip install bump2version + + - name: Configure git + shell: bash + run: | + git config user.name github-actions + git config user.email github-actions@github.com + + - name: Bump version + shell: bash + run: | + bump2version patch --tag --verbose + + - name: Push changes + uses: ad-m/github-push-action@master + with: + github_token: ${{ secrets.PAT_RELEASE_PACKAGES }} + branch: ${{ github.ref }} + tags: true + + publish: + runs-on: ubuntu-latest + needs: bump + steps: + - name: Checkout + uses: actions/checkout@v2 + with: + fetch-depth: 0 + + - name: Set up Python + uses: actions/setup-python@v4 + with: + python-version: 3.8 + + - name: Install python dependencies + run: | + python -m pip install --upgrade pip + pip --no-cache-dir install setuptools wheel "urllib3==1.25.11" + pip --no-cache-dir install -e .[tests,docs] + + - name: Show python dependencies + run: | + pip freeze + + - name: Build package + run: | + mkdir clean-build + python setup.py sdist bdist_wheel --universal --dist-dir ./clean-build + + - name: Publish package + uses: pypa/gh-action-pypi-publish@v1.3.1 + with: + verify_metadata: false + user: __token__ + password: ${{ secrets.pypi_password }} + packages_dir: clean-build/ diff --git a/setup.py b/setup.py index 5b0818a..141d030 100644 --- a/setup.py +++ b/setup.py @@ -67,9 +67,6 @@ setup( name="inspire-dojson", - autosemver={ - "bugtracker_url": URL + "/issues", - }, url=URL, license="GPLv3", author="CERN",