Skip to content

Commit 408d95a

Browse files
committed
admin: Sign release artifacts (#4580)
Approach copied from OpenEXR. Let's try it! Fixes #4404 Signed-off-by: Larry Gritz <[email protected]>
1 parent 0f81385 commit 408d95a

File tree

1 file changed

+67
-0
lines changed

1 file changed

+67
-0
lines changed

.github/workflows/release-sign.yml

Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
# SPDX-License-Identifier: Apache-2.0
2+
# Copyright (c) Contributors to the OpenImageIO Project.
3+
4+
#
5+
# Releases are signed via https://github.com/sigstore/sigstore-python.
6+
# See https://docs.sigstore.dev for information about sigstore.
7+
#
8+
# This action creates a .tar.gz of the complete OpenImageIO source tree at
9+
# the given release tag, signs it via sigstore, and uploads the
10+
# .tar.gz and the associated .tar.gz.sigstore credential bundle.
11+
#
12+
# To verify a downloaded release at a given tag:
13+
#
14+
# % pip install sigstore
15+
# % sigstore verify github --cert-identity https://github.com/AcademySoftwareFoundation/OpenImageIO/.github/workflows/release-sign.yml@refs/tags/<tag> OpenImageIO-<tag>.tar.gz
16+
#
17+
18+
name: Sign Release
19+
20+
on:
21+
release:
22+
types: [published]
23+
24+
permissions:
25+
contents: read
26+
27+
jobs:
28+
release:
29+
name: Sign & upload release artifacts
30+
runs-on: ubuntu-latest
31+
32+
env:
33+
TAG: ${{ github.ref_name }}
34+
permissions:
35+
contents: write
36+
id-token: write
37+
repository-projects: write
38+
39+
steps:
40+
41+
- name: Set Prefix
42+
# The tag name begins with a 'v', e.g. "v3.0.3", but the prefix
43+
# should omit the 'v', so the tarball "OpenImageIO-3.0.3.tar.gz"
44+
# extracts files into "OpenImageIO-v3.0.3/...". This matches
45+
# the GitHub release page autogenerated artifact conventions.
46+
run: |
47+
echo OPENIMAGEIO_PREFIX=OpenImageIO-${TAG//v}/ >> $GITHUB_ENV
48+
echo OPENIMAGEIO_TARBALL=OpenImageIO-${TAG//v}.tar.gz >> $GITHUB_ENV
49+
shell: bash
50+
51+
- name: Checkout
52+
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
53+
54+
- name: Create archive
55+
run: git archive --format=tar.gz -o ${OPENIMAGEIO_TARBALL} --prefix ${OPENIMAGEIO_PREFIX} ${TAG}
56+
57+
- name: Sign archive with Sigstore
58+
uses: sigstore/gh-action-sigstore-python@f514d46b907ebcd5bedc05145c03b69c1edd8b46 # v3.0.0
59+
with:
60+
inputs: ${{ env.OPENIMAGEIO_TARBALL }}
61+
upload-signing-artifacts: false
62+
release-signing-artifacts: false
63+
64+
- name: Upload release archive
65+
env:
66+
GH_TOKEN: ${{ github.token }}
67+
run: gh release upload ${TAG} ${OPENIMAGEIO_TARBALL} ${OPENIMAGEIO_TARBALL}.sigstore.json

0 commit comments

Comments
 (0)