|
| 1 | +# SPDX-License-Identifier: BSD-3-Clause |
| 2 | +# Copyright Contributors to the OpenColorIO 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 OpenColorIO 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/OpenColorIO/.github/workflows/release-sign.yml@refs/tags/<tag> OpenColorIO-<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. "v2.4.0", but the prefix |
| 43 | + # should omit the 'v', so the tarball "OpenColorIO-2.4.0.tar.gz" |
| 44 | + # extracts files into "OpenColorIO-2.4.0/...". This matches |
| 45 | + # the GitHub release page autogenerated artifact conventions. |
| 46 | + run: | |
| 47 | + echo OCIO_PREFIX=OpenColorIO-${TAG//v}/ >> $GITHUB_ENV |
| 48 | + echo OCIO_TARBALL=OpenColorIO-${TAG//v}.tar.gz >> $GITHUB_ENV |
| 49 | + shell: bash |
| 50 | + |
| 51 | + - name: Checkout |
| 52 | + uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 |
| 53 | + |
| 54 | + - name: Create archive |
| 55 | + run: git archive --format=tar.gz -o ${OCIO_TARBALL} --prefix ${OCIO_PREFIX} ${TAG} |
| 56 | + |
| 57 | + - name: Sign archive with Sigstore |
| 58 | + uses: sigstore/gh-action-sigstore-python@a5caf349bc536fbef3668a10ed7f5cd309a4b53d # v3.2.0 |
| 59 | + with: |
| 60 | + inputs: ${{ env.OCIO_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} ${OCIO_TARBALL} ${OCIO_TARBALL}.sigstore.json |
0 commit comments