Skip to content

Commit

Permalink
Clean up gpg-sign and papertrail actions (#5)
Browse files Browse the repository at this point in the history
* remove quotes

* update papertrail

* update papertrail

* cleanup

* require version

* fix name
  • Loading branch information
blink1073 authored May 10, 2024
1 parent 08c9ab0 commit 798f0de
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 14 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ You can also supply multiple space-separated filenames to sign a list of files:
- name: "Create detached signature"
uses: mongodb/drivers-github-tools/garasign/gpg-sign@main
with:
filenames: somefile.ext someotherfile.txt
filenames: dist/*
garasign_username: ${{ secrets.GRS_CONFIG_USER1_USERNAME }}
garasign_password: ${{ secrets.GRS_CONFIG_USER1_PASSWORD }}
artifactory_username: ${{ secrets.ARTIFACTORY_USER }}
Expand All @@ -87,6 +87,6 @@ By default it will create a "papertrail.txt" file in the current directory.
with:
product_name: Mongo Python Driver
release_version: ${{ github.ref_name }}
filenames: $DIST_FILES
filenames: dist/*
token: ${{ github.token }}
```
4 changes: 2 additions & 2 deletions garasign/gpg-sign/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: "Sign artifact using garasign"
description: "Signs a release artifact"
inputs:
filenames:
description: "File names to sign, space separated"
description: "File name(s) to sign, can be a glob pattern"
required: true
garasign_username:
description: "Garasign username"
Expand Down Expand Up @@ -54,5 +54,5 @@ runs:
-v $(pwd):$(pwd) \
-w $(pwd) \
${{ inputs.artifactory_registry }}/${{ inputs.artifactory_image }} \
/bin/bash -c 'gpgloader && for filename in "${{ inputs.filenames }}"; do gpg --detach-sign --armor --output ${filename}.sig ${filename}; done'
/bin/bash -c 'gpgloader && for filename in ${{ inputs.filenames }}; do gpg --detach-sign --armor --output ${filename}.sig ${filename}; done'
shell: bash
16 changes: 6 additions & 10 deletions papertrail/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,17 @@ inputs:
description: "Name of product"
required: true
release_version:
description: "The release version. If not provided, the github.ref_name variable will be used"
required: false
description: "The release version"
required: true
filenames:
description: "Artifact filenames to include in the report, space-separated"
description: "Artifact filename(s) to include in the report, can be a glob pattern"
required: true
token:
description: "The GitHub token for the action"
required: true
output:
description: "The output filename"
default: "papertail.txt"
default: "papertrail.txt"

runs:
using: composite
Expand All @@ -26,16 +26,12 @@ runs:
export GH_TOKEN=${{ inputs.token }}
NAME=$(gh api users/${{ github.actor }} --jq '.name')
export PAPERTRAIL="${{ inputs.output }}"
export VERSION="${{ github.ref_name }}"
if [ -n "${{ inputs.release_version }}" ]; then
export VERSION="${{ inputs.release_version }}"
fi
echo "Product: ${{ inputs.product_name }}" > $PAPERTRAIL
echo "Version: $VERSION" >> $PAPERTRAIL
echo "Version: ${{ inputs.release_version }}" >> $PAPERTRAIL
echo "Releaser: $NAME" >> $PAPERTRAIL
echo "Build Source: GitHub Actions"
echo "Build Number: ${{ github.run_id }}"
for filename in"${{ inputs.filenames }}"; do
for filename in ${{ inputs.filenames }}; do
SHA=$(shasum -a 256 $filename | awk '{print $1;}')
echo "Filename: $filename" >> $PAPERTRAIL
echo "Shasum: $SHA" >> $PAPERTRAIL
Expand Down

0 comments on commit 798f0de

Please sign in to comment.