From b6f31bfba7898778b71df3b1ac14a3cd51a2500e Mon Sep 17 00:00:00 2001 From: Cary Phillips Date: Wed, 14 Feb 2024 10:37:21 -0800 Subject: [PATCH] Add workflow to sign release artifacts with Sigstore Replicates the openexr workflow: https://github.com/AcademySoftwareFoundation/openexr/pull/1637 Signed-off-by: Cary Phillips --- .github/workflows/release-sign.yml | 57 ++++++++++++++++++++++++++++++ 1 file changed, 57 insertions(+) create mode 100644 .github/workflows/release-sign.yml diff --git a/.github/workflows/release-sign.yml b/.github/workflows/release-sign.yml new file mode 100644 index 00000000..3133be78 --- /dev/null +++ b/.github/workflows/release-sign.yml @@ -0,0 +1,57 @@ +# SPDX-License-Identifier: BSD-3-Clause +# Copyright (c) Contributors to the OpenEXR Project. + +name: Sign Release + +on: + release: + types: [created] + +permissions: + contents: write + id-token: write + repository-projects: write + +jobs: + release: + name: Sign & upload release artifacts + runs-on: ubuntu-latest + + steps: + + - name: Checkout + uses: actions/checkout@v2 + + - name: Create archive + run: git archive --format=tar.gz -o Imath-${{ github.ref_name }}.tar.gz ${{ github.ref_name }} + + - name: Sign archive with Sigstore + uses: sigstore/gh-action-sigstore-python@v2.1.0 + with: + inputs: Imath-${{ github.ref_name }}.tar.gz + + - name: Get release tag + id: get_release + uses: bruceadams/get-release@v1.3.2 + env: + GITHUB_TOKEN: ${{ github.token }} + + - name: Upload release archive + uses: actions/upload-release-asset@v1.0.2 + env: + GITHUB_TOKEN: ${{ github.token }} + with: + upload_url: ${{ steps.get_release.outputs.upload_url }} + asset_path: Imath-${{ github.ref_name }}.tar.gz + asset_name: Imath-${{ github.ref_name }}.tar.gz + asset_content_type: application/zip + + - name: Upload release sigstore + uses: actions/upload-release-asset@v1.0.2 + env: + GITHUB_TOKEN: ${{ github.token }} + with: + upload_url: ${{ steps.get_release.outputs.upload_url }} + asset_path: Imath-${{ github.ref_name }}.tar.gz.sigstore + asset_name: Imath-${{ github.ref_name }}.tar.gz.sigstore + asset_content_type: application/zip \ No newline at end of file