|
| 1 | +# Copyright 2024 The Sigstore Authors |
| 2 | +# |
| 3 | +# Licensed under the Apache License, Version 2.0 (the "License"); |
| 4 | +# you may not use this file except in compliance with the License. |
| 5 | +# You may obtain a copy of the License at |
| 6 | +# |
| 7 | +# http://www.apache.org/licenses/LICENSE-2.0 |
| 8 | +# |
| 9 | +# Unless required by applicable law or agreed to in writing, software |
| 10 | +# distributed under the License is distributed on an "AS IS" BASIS, |
| 11 | +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 12 | +# See the License for the specific language governing permissions and |
| 13 | +# limitations under the License. |
| 14 | + |
| 15 | +name: Release |
| 16 | + |
| 17 | +on: |
| 18 | + tags: |
| 19 | + - v* |
| 20 | + |
| 21 | +permissions: {} |
| 22 | + |
| 23 | +jobs: |
| 24 | + build_wheel: |
| 25 | + name: Build the wheel |
| 26 | + if: github.repository == 'sigstore/model-transparency' # Don't do this in forks |
| 27 | + runs-on: ubuntu-latest # Use matrix when we have OS specific pieces |
| 28 | + steps: |
| 29 | + - uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 |
| 30 | + - name: Set up Hatch |
| 31 | + uses: pypa/hatch@257e27e51a6a5616ed08a39a408a21c35c9931bc |
| 32 | + - name: Build artifacts |
| 33 | + run: hatch build |
| 34 | + - uses: actions/upload-artifact@834a144ee995460fba8ed112a2fc961b36a5ec5a # v4.3.6 |
| 35 | + with: |
| 36 | + path: dist/ |
| 37 | + name: dist.zip |
| 38 | + if-no-files-found: error |
| 39 | + retention-days: 1 |
| 40 | + |
| 41 | + publish_release_to_pypi: |
| 42 | + name: Publish release to PyPI |
| 43 | + needs: [build_wheel] |
| 44 | + runs-on: ubuntu-latest |
| 45 | + environment: |
| 46 | + name: pypi |
| 47 | + url: https://pypi.org/project/model-signing/ |
| 48 | + permissions: |
| 49 | + id-token: write |
| 50 | + steps: |
| 51 | + - uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4.1.8 |
| 52 | + with: |
| 53 | + name: dist.zip |
| 54 | + path: dist/ |
| 55 | + - uses: pypa/gh-action-pypi-publish@ec4db0b4ddc65acdf4bff5fa45ac92d78b56bdf0 # v1.9.0 |
| 56 | + |
| 57 | + # TODO: Create and publish release notes |
| 58 | + # TODO: Generate SLSA provenance for the wheels |
| 59 | + # TODO: Sign artifacts with sigstore and publish to release page |
0 commit comments