mozilla / mozdownload

Easy to use download tool and API for different types of Firefox and Thunderbird builds
http://pypi.python.org/pypi/mozdownload
Other
70 stars 77 forks source link

Action to auto publish PyPI #686

Closed libialany closed 4 months ago

libialany commented 5 months ago

Fixes https://github.com/mozilla/mozdownload/issues/669.

Thank you for reviewing my latest pull request, and I've made improvements in the following ways:

  1. pypa/gh-action-pypi-publish@release/v1 accepts either a password or PyPI token. Utilize the token instead of the user's password also i change the variable name to pypi_token.
  2. Added a secret variable for specifying the Python version. Referring to the documentation of actions/setup-python@v5 , I've set it to '3.11.9', aligning with the available Python versions for that GitHub Action.
  3. Implemented the use of artifacts to transfer the 'dist' folder between jobs (actions/download-artifact@v4, actions/upload-artifact@v4).
  4. Set condition for publishing, ensuring the last step succeeds, the secret is not empty, and the event is push and is a tagged commit.
whimboo commented 5 months ago

@libialany thanks for the update. In case another update is required after my review please to keep working on this PR and please do not create a new one again. Thanks.

libialany commented 5 months ago

I have corrected the errors I had. Could you please review it?, improved

libialany commented 5 months ago

I have corrected the errors I had.improved version. Thank you very much for the link. I didn't apply a test job because I believe the tests are fully covered with test.yml. Could you please review it?,

whimboo commented 4 months ago

FYI I created a PR to fix the tests at https://github.com/mozilla/mozdownload/pull/692.

libialany commented 4 months ago

Thank you!. I have improved the release.yml and attempted to integrate the test.yml workflow:

workflow_run:
  workflows: [ Test ] # Name of the test.yml workflow
  types: [ completed ]    # Trigger when the test workflow completes
  branches: [ master ]    # Run in the master branch; the branch must be the default branch (if you specify a branch that isn't the default, it will never run)

I also added a condition to the deploy job to check if the completed test workflow was successful:

if: ${{ github.event.workflow_run.conclusion == 'success' }}

I will learn more about testing in GitHub Actions and will review the documentation at #692. link resources: branches work_on