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

Implement current best practice for using Github Actions for package building and PyPI distribution #182

Merged
merged 8 commits into from
Aug 22, 2024

Conversation

kjd
Copy link
Owner

@kjd kjd commented Aug 22, 2024

No description provided.

@sethmlarson
Copy link
Collaborator

To avoid opening the release process up to supply-chain attacks targetting basic GitHub Actions (ie actions/checkout, actions/setup-python) I recommend keeping the workflows pinned to SHA hashes:

-    - uses: actions/checkout@v4
-    - name: Set up Python
-      uses: actions/setup-python@v5
-      with:
-        python-version: "3.x"
-    - name: Install pypa/build
-      run: python3 -m pip install build --user
-    - name: Build a binary wheel and a source tarball
-      run: python3 -m build
-    - name: Store the distribution packages
-      uses: actions/upload-artifact@v4
-      with:
-        name: python-package-distributions
-        path: dist/
-
+      - uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4
+      - name: Set up Python
+        uses: actions/setup-python@39cd14951b08e74b54015e9e001cdefcf80e669f # v5
+        with:
+          python-version: "3.x"
+      - name: Install pypa/build
+        run: python3 -m pip install build --user
+      - name: Build a binary wheel and a source tarball
+        run: python3 -m build
+      - name: Store the distribution packages
+        uses: actions/upload-artifact@834a144ee995460fba8ed112a2fc961b36a5ec5a # v4
+        with:
+          name: python-package-distributions
+          path: dist/

@kjd
Copy link
Owner Author

kjd commented Aug 22, 2024

Thanks for the suggestion @sethmlarson, will do.

@kjd kjd merged commit 12d4dd1 into master Aug 22, 2024
35 checks passed
@kjd kjd deleted the github-pypi-actions branch August 22, 2024 22:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants