Skip to content

Commit

Permalink
Use cosign and gh
Browse files Browse the repository at this point in the history
Signed-off-by: Cary Phillips <[email protected]>
  • Loading branch information
cary-ilm committed Feb 16, 2024
1 parent b6f31bf commit 5ae58ce
Showing 1 changed file with 11 additions and 27 deletions.
38 changes: 11 additions & 27 deletions .github/workflows/release-sign.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,45 +13,29 @@ permissions:
repository-projects: write

jobs:
release:
sign-release:
name: Sign & upload release artifacts
runs-on: ubuntu-latest
env:
tarball: Imath-${{ github.ref_name }}.tar.gz

steps:
- name: Install Cosign
uses: sigstore/[email protected]
with:
cosign-release: 'v2.2.2'

- 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 }}
run: git archive --format=tar.gz -o ${{ env.tarball }} ${{ github.ref_name }}

- name: Sign archive with Sigstore
uses: sigstore/[email protected]
with:
inputs: Imath-${{ github.ref_name }}.tar.gz

- name: Get release tag
id: get_release
uses: bruceadams/[email protected]
env:
GITHUB_TOKEN: ${{ github.token }}
run: cosign sign-blob --yes ${{ env.tarball }} --bundle ${{ env.tarball }}-cosign.bundle

- name: Upload release archive
uses: actions/[email protected]
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
GH_TOKEN: ${{ github.token }}
run: gh release upload ${{ github.ref_name }} ${{ env.tarball }} ${{ env.tarball }}-cosign.bundle

- name: Upload release sigstore
uses: actions/[email protected]
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 5ae58ce

Please sign in to comment.