From a58dcaea9804d6152a14d8fe57af3ef0c6f73213 Mon Sep 17 00:00:00 2001 From: Clemens Lange Date: Wed, 15 Nov 2023 11:17:48 +0100 Subject: [PATCH] Remove broken release action (#239) * Remove broken release action * Remove automatic releease creation from docs --- .github/workflows/release.yml | 152 ---------------------------------- docs/contributing.rst | 10 --- 2 files changed, 162 deletions(-) delete mode 100644 .github/workflows/release.yml diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml deleted file mode 100644 index 0878a6e5..00000000 --- a/.github/workflows/release.yml +++ /dev/null @@ -1,152 +0,0 @@ -name: release - -# Triggers when new issue is opened -on: - issues: - types: [opened] - -jobs: - - # Action to bump version and push tag - Bump-version: - if: startsWith(github.event.issue.title, 'release') && (startsWith(github.event.issue.body, 'patch') || - startsWith(github.event.issue.body, 'minor') || startsWith(github.event.issue.body, 'major')) - runs-on: [ubuntu-latest] - strategy: - matrix: - python-version: [3.6] - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - steps: - - uses: actions/checkout@master - with: - persist-credentials: false - - # Check for permissions - - uses: scherermichael/action-has-permission@master - id: check - with: - required-permission: write - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - - name: Set up Python ${{ matrix.python-version }} - if: steps.check.outputs.has-permission - uses: actions/setup-python@v1 - with: - python-version: ${{ matrix.python-version }} - - # Bump version - - uses: geertvdc/setup-hub@master - - name: Bump version and tag - if: steps.check.outputs.has-permission - run: | - git config --global user.email ${{ github.actor }}@users.noreply.github.com - git config --global user.name ${{ github.actor }} - git pull - python -m pip install --upgrade bumpversion - bumpversion ${{ github.event.issue.body }} - - # Push tags - - name: Push changes - if: steps.check.outputs.has-permission - uses: ad-m/github-push-action@master - with: - github_token: ${{ secrets.access_token }} - tags: true - branch: main - - # Action to build and publish distribution to PyPI and TestPyPI - build-and-publish: - needs: Bump-version - name: Build and publish Python distribution to PyPI and TestPyPI - runs-on: ubuntu-18.04 - env: - version: 0.0.0 - container: - image: 'rootproject/root:latest' - steps: - - uses: actions/checkout@master - - uses: scherermichael/action-has-permission@master - id: check2 - with: - required-permission: write - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - - uses: geertvdc/setup-hub@master - - # Build package - - name: Create package - id: version - if: steps.check2.outputs.has-permission - run: | - git config --global user.email ${{ github.actor }}@users.noreply.github.com - git config --global user.name ${{ github.actor }} - git pull - yum install -y python-pip ghostscript - python -m pip install pytest_pylint configparser astroid pyyml papermill future - echo "::set-output name=version::$(python -c "from hepdata_lib import __version__; print(__version__)")" - python -m pip install wheel - python setup.py sdist bdist_wheel - - # Publish package to test PyPI - - name: Publish distribution to Test PyPI - if: steps.check2.outputs.has-permission - uses: pypa/gh-action-pypi-publish@master - with: - user: __token__ - password: ${{ secrets.test_pypi_password }} - repository_url: https://test.pypi.org/legacy/ - - # Sleep - - name: Sleep for 300 seconds - uses: jakejarvis/wait-action@master - with: - time: '300s' - - # Run tests - - name: Test with pytest - run: | - pip install --index-url https://test.pypi.org/simple/ hepdata_lib==${{ steps.version.outputs.version }} - python setup.py test - python -m pylint hepdata_lib/*.py - python -m pylint tests/*.py --rcfile=tests/pylintrc - - # Add automatic comment on the issue - - name: Create comment - if: steps.check2.outputs.has-permission - uses: jungwinter/comment@v1 - id: create - with: - type: create - body: | - Test PyPI release version: ${{ steps.version.outputs.version }} - - https://test.pypi.org/project/hepdata-lib/${{ steps.version.outputs.version }}/ - issue_number: ${{ github.event.issue.number }} - token: ${{ secrets.GITHUB_TOKEN }} - - # Publish to PyPI - - name: Publish distribution to PyPI - if: steps.check2.outputs.has-permission - uses: pypa/gh-action-pypi-publish@master - with: - user: __token__ - password: ${{ secrets.pypi_password }} - - # Add automatic comment on the issue - - name: Create comment - if: steps.check2.outputs.has-permission - uses: jungwinter/comment@v1 - id: create2 - with: - type: create - body: | - PyPI release version: ${{ steps.version.outputs.version }} - - https://pypi.org/project/hepdata-lib/ - issue_number: ${{ github.event.issue.number }} - token: ${{ secrets.GITHUB_TOKEN }} - - # Close issue - - name: Close Issue - uses: peter-evans/close-issue@v3 - with: - issue-number: ${{ github.event.issue.number }} diff --git a/docs/contributing.rst b/docs/contributing.rst index 87b04015..cb4eae9e 100644 --- a/docs/contributing.rst +++ b/docs/contributing.rst @@ -70,13 +70,3 @@ You should then find the new version at `this location`_. You need to be a maint .. _PyPI test server: https://test.pypi.org/project/hepdata_lib/ .. _this location: https://pypi.org/project/hepdata_lib/ .. _python packaging documentation: https://packaging.python.org/tutorials/packaging-projects/ - -Creating a new release automatically via an issue -------------------------------------------------- - -Opening an new issue automatically creates a new release if: - -- The title of the issue starts with the word "release" (not case-sensitive). -- The body of the issue contains only one of the following words: "patch", "minor" or "major". - -Remember to set the following github secrets: "test_pypi_password" , "pypi_password" and your personal access token to "access_token". This also uses the API token feature of PyPI.