Skip to content

Commit 71dd759

Browse files
authored
admin: Sign release artifacts (#1913)
Closes #1857 Same approach that was taken by OpenEXR and OpenImageIO. Signed-off-by: Larry Gritz <[email protected]>
1 parent b6055bf commit 71dd759

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: BSD-3-Clause
2+
# Copyright (c) Contributors to the Open Shading Language 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 OSL 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/OpenShadingLanguage/.github/workflows/release-sign.yml@refs/tags/<tag> OSL-<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. "v1.14.3", but the prefix
43+
# should omit the 'v', so the tarball "OSL-1.14.3.tar.gz"
44+
# extracts files into "OSL-v1.14.3/...". This matches
45+
# the GitHub release page autogenerated artifact conventions.
46+
run: |
47+
echo OSL_PREFIX=OSL-${TAG//v}/ >> $GITHUB_ENV
48+
echo OSL_TARBALL=OSL-${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 ${OSL_TARBALL} --prefix ${OSL_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.OSL_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} ${OSL_TARBALL} ${OSL_TARBALL}.sigstore.json

0 commit comments

Comments
 (0)