Skip to content

Commit

Permalink
Merge pull request #202 from atsign-foundation/cpswan-fix-dist
Browse files Browse the repository at this point in the history
ci: Download after checkout
  • Loading branch information
cpswan authored May 9, 2024
2 parents a7f9dee + 50a653f commit 25f3cfa
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 211 deletions.
34 changes: 13 additions & 21 deletions .github/workflows/build-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,29 +18,26 @@ jobs:
steps:
- name: Checkout this repo
uses: actions/checkout@44c2b7a8a4ea60a981eaca3cf939b5f4305c123b # v4.1.5

- name: Set up Python
uses: actions/setup-python@82c7e631bb3cdc910f68e0081d67478d79c6982d # v5.1.0
with:
python-version: '3.11'

- name: Install Poetry
uses: abatilo/actions-poetry@7b6d33e44b4f08d7021a1dee3c044e9c253d6439 # v3.0.0
with:
poetry-version: '1.8.2'

# The dark mode and light mode Atsign logos in the GitHub README don't
# show properly on PyPI so we have a copy of the README.md in
# README.PyPI.md with just the light mode logo.
# This step checks that we don't have drift between the docs.
- name: Check that READMEs are in sync
# That README is generated here from a stub header line plus the rest
# of the main README.md
- name: Generate README for PyPI
run: |
diff <(tail -n +2 README.md) <(tail -n +2 README.PyPI.md)
mv README.PyPI.md.stub README.PyPI.md
tail -n +2 README.md >> README.PyPI.md
- name: Build using Poetry
run: |
poetry build
- name: Store the distribution packages
uses: actions/upload-artifact@65462800fd760344b1a7b4382951275a0abb4808 # v4.3.3
with:
Expand All @@ -52,14 +49,11 @@ jobs:
needs:
- build
runs-on: ubuntu-latest

environment:
name: testpypi
url: https://test.pypi.org/p/atsdk

permissions:
id-token: write # IMPORTANT: mandatory for trusted publishing

steps:
- name: Download all the dists
uses: actions/download-artifact@65a9edc5881444af0b9093a5e628f2fe47ea3b2e # v4.1.7
Expand All @@ -83,7 +77,6 @@ jobs:
url: https://pypi.org/p/atsdk
permissions:
id-token: write # IMPORTANT: mandatory for trusted publishing

steps:
- name: Download all the dists
uses: actions/download-artifact@65a9edc5881444af0b9093a5e628f2fe47ea3b2e # v4.1.7
Expand All @@ -92,6 +85,8 @@ jobs:
path: dist/
- name: Publish distribution to PyPI
uses: pypa/gh-action-pypi-publish@81e9d935c883d0b210363ab89cf05f3894778450 # v1.8.14
with:
skip-existing: true

github-release:
name: Attest Python distribution artifacts and upload them to the GitHub Release
Expand All @@ -100,23 +95,21 @@ jobs:
runs-on: ubuntu-latest
outputs:
hashes: ${{ steps.hash.outputs.hashes }}

permissions:
contents: write # IMPORTANT: mandatory for making GitHub Releases
id-token: write # IMPORTANT: mandatory for sigstore
attestations: write

steps:
- name: Download all the dists
uses: actions/download-artifact@65a9edc5881444af0b9093a5e628f2fe47ea3b2e # v4.1.7
with:
name: python-package-distributions
path: dist/
- name: Checkout requirements.txt
uses: actions/checkout@44c2b7a8a4ea60a981eaca3cf939b5f4305c123b # v4.1.5
with:
sparse-checkout: requirements.txt
sparse-checkout-cone-mode: false
- name: Download all the dists
uses: actions/download-artifact@65a9edc5881444af0b9093a5e628f2fe47ea3b2e # v4.1.7
with:
name: python-package-distributions
path: dist/
- name: Install Syft
uses: anchore/sbom-action/download-syft@7ccf588e3cf3cc2611714c2eeae48550fbc17552 # v0.15.11
- name: Generate SBOMs
Expand All @@ -140,8 +133,7 @@ jobs:
env:
GITHUB_TOKEN: ${{ github.token }}
# Upload to GitHub Release using the `gh` CLI.
# `dist/` contains the built packages, and the
# sigstore-produced signatures and certificates.
# `dist/` contains the built packages
run: >-
gh release upload
'${{ github.ref_name }}' dist/**
Expand Down
190 changes: 0 additions & 190 deletions README.PyPI.md

This file was deleted.

1 change: 1 addition & 0 deletions README.PyPI.md.stub
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
<h1><img width=250px src="https://atsign.com/wp-content/uploads/2022/05/atsign-logo-horizontal-color2022.svg" alt="The Atsign Foundation"></h1>
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<h1><a href="https://atsign.com#gh-light-mode-only"><img width=250px src="https://atsign.com/wp-content/uploads/2022/05/atsign-logo-horizontal-color2022.svg#gh-light-mode-only" alt="The Atsign Foundation"></a><a href="https://atsign.com#gh-dark-mode-only"><img width=250px src="https://atsign.com/wp-content/uploads/2023/08/atsign-logo-horizontal-reverse2022-Color.svg#gh-dark-mode-only" alt="The Atsign Foundation"></a>

[![GitHub License](https://img.shields.io/badge/license-BSD3-blue.svg)](./LICENSE)
[![PyPI version](https://badge.fury.io/py/atsdk.svg)](https://badge.fury.io/py/atsdk)
[![OpenSSF Scorecard](https://api.securityscorecards.dev/projects/github.com/atsign-foundation/at_python/badge)](https://securityscorecards.dev/viewer/?uri=github.com/atsign-foundation/at_python&sort_by=check-score&sort_direction=desc)
[![OpenSSF Best Practices](https://www.bestpractices.dev/projects/8104/badge)](https://www.bestpractices.dev/projects/8104)

Expand Down

0 comments on commit 25f3cfa

Please sign in to comment.