Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Simplify Publish workflow #5802

Merged
merged 3 commits into from
Feb 2, 2023
Merged

Simplify Publish workflow #5802

merged 3 commits into from
Feb 2, 2023

Conversation

Laerte
Copy link
Member

@Laerte Laerte commented Jan 21, 2023

Simplify publish workflow by using official PyPI publish action.

@codecov
Copy link

codecov bot commented Jan 21, 2023

Codecov Report

Merging #5802 (4a424ad) into master (9cb757d) will increase coverage by 0.01%.
The diff coverage is n/a.

@@            Coverage Diff             @@
##           master    #5802      +/-   ##
==========================================
+ Coverage   88.93%   88.94%   +0.01%     
==========================================
  Files         162      162              
  Lines       10988    11002      +14     
  Branches     1797     1798       +1     
==========================================
+ Hits         9772     9786      +14     
  Misses        937      937              
  Partials      279      279              
Impacted Files Coverage Δ
scrapy/item.py 98.36% <0.00%> (ø)
scrapy/link.py 100.00% <0.00%> (ø)
scrapy/mail.py 78.65% <0.00%> (ø)
scrapy/shell.py 68.65% <0.00%> (ø)
scrapy/cmdline.py 67.96% <0.00%> (ø)
scrapy/crawler.py 87.17% <0.00%> (ø)
scrapy/pqueues.py 99.17% <0.00%> (ø)
scrapy/squeues.py 100.00% <0.00%> (ø)
scrapy/__init__.py 84.21% <0.00%> (ø)
scrapy/resolver.py 92.20% <0.00%> (ø)
... and 128 more

@elacuesta elacuesta added the CI label Jan 22, 2023
@Laerte
Copy link
Member Author

Laerte commented Jan 23, 2023

💡 We could even simplify this workflow:

name: Publish
on:
  push:
    tags:
      - '[0-9]+.[0-9]+.[0-9]+'
      - '[0-9]+.[0-9]+.[0-9]+rc[0-9]+' # Release Candidate
      - '[0-9]+.[0-9]+.[0-9]+.dev[0-9]+' # Development

jobs:
  publish:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v3
      - uses: actions/setup-python@v4
        with:
          python-version: 3.11
      - run: | 
          pip install --upgrade build twine
          python -m build
      - name: Publish to PyPI
        uses: pypa/gh-action-pypi-publish@release/v1
        with:
          password: ${{ secrets.PYPI_TOKEN }}

With this we can remove the Check Tag step and this action will be only executed when we push a new tag that matches our pattern.

Copy link
Member

@Gallaecio Gallaecio left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@Gallaecio
Copy link
Member

The proposed simplification also sounds good to me. In fact, we haven’t released an rc or dev version in years, and I don’t expect us to do so any time soon, so we could even remove those 2 patterns as well.

@Laerte Laerte changed the title set-output command is deprecated Simplify Publish workflow Feb 2, 2023
@Laerte
Copy link
Member Author

Laerte commented Feb 2, 2023

@Gallaecio I pushed the refactor, i also use the same workflow on my personal project: https://github.com/Laerte/aes_pkcs5/blob/main/.github/workflows/publish.yml and works flawless!

Copy link
Member

@Gallaecio Gallaecio left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

❤️

@kmike
Copy link
Member

kmike commented Feb 2, 2023

Thanks @Laerte!

@kmike kmike merged commit a08d722 into scrapy:master Feb 2, 2023
@Laerte Laerte deleted the chore/deprecate-set-output branch February 2, 2023 15:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants