Skip to content

Commit

Permalink
Add trusted publishing workflow
Browse files Browse the repository at this point in the history
Signed-off-by: Mihai Maruseac <mihaimaruseac@google.com>
  • Loading branch information
mihaimaruseac committed Aug 27, 2024
1 parent ae62038 commit 7e6308d
Show file tree
Hide file tree
Showing 3 changed files with 74 additions and 1 deletion.
14 changes: 14 additions & 0 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,17 @@
# Copyright 2024 The Sigstore Authors
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

name: Documentation

on:
Expand Down
59 changes: 59 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
# Copyright 2024 The Sigstore Authors
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

name: Release

on:
tags:
- v*

permissions: {}

jobs:
build_wheel:
name: Build the wheel
if: github.repository == 'sigstore/model-transparency' # Don't do this in forks
runs-on: ubuntu-latest # Use matrix when we have OS specific pieces
steps:
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
- name: Set up Hatch
uses: pypa/hatch@257e27e51a6a5616ed08a39a408a21c35c9931bc
- name: Build artifacts
run: hatch build
- uses: actions/upload-artifact@834a144ee995460fba8ed112a2fc961b36a5ec5a # v4.3.6
with:
path: dist/
name: dist.zip
if-no-files-found: error
retention-days: 1

publish_release_to_pypi:
name: Publish release to PyPI
needs: [build_wheel]
runs-on: ubuntu-latest
environment:
name: pypi
url: https://pypi.org/project/model-signing/
permissions:
id-token: write
steps:
- uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4.1.8
with:
name: dist.zip
path: dist/
- uses: pypa/gh-action-pypi-publish@ec4db0b4ddc65acdf4bff5fa45ac92d78b56bdf0 # v1.9.0

# TODO: Create and publish release notes
# TODO: Generate SLSA provenance for the wheels
# TODO: Sign artifacts with sigstore and publish to release page
2 changes: 1 addition & 1 deletion src/model_signing/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,4 @@
# See the License for the specific language governing permissions and
# limitations under the License.

__version__ = "0.0.1-alpha"
__version__ = "0.0.2-alpha"

0 comments on commit 7e6308d

Please sign in to comment.