Skip to content

Commit

Permalink
Add workflow to sign release artifacts with Sigstore
Browse files Browse the repository at this point in the history
Replicates the openexr workflow:
AcademySoftwareFoundation/openexr#1637

Signed-off-by: Cary Phillips <cary@ilm.com>
  • Loading branch information
cary-ilm committed Feb 14, 2024
1 parent 51abc0f commit b6f31bf
Showing 1 changed file with 57 additions and 0 deletions.
57 changes: 57 additions & 0 deletions .github/workflows/release-sign.yml
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit b6f31bf

Please sign in to comment.