Skip to content

Commit

Permalink
Log GPG info.
Browse files Browse the repository at this point in the history
  • Loading branch information
jefchien committed Nov 18, 2024
1 parent 4ec6d35 commit a4c6a42
Showing 1 changed file with 43 additions and 37 deletions.
80 changes: 43 additions & 37 deletions .github/workflows/test-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -81,50 +81,56 @@ jobs:
- name: Install rpm
run: sudo apt install rpm

- name: Configure AWS Credentials
uses: aws-actions/configure-aws-credentials@v2
with:
role-to-assume: ${{ inputs.TerraformAWSAssumeRole }}
aws-region: ${{ inputs.Region }}
# - name: Configure AWS Credentials
# uses: aws-actions/configure-aws-credentials@v2
# with:
# role-to-assume: ${{ inputs.TerraformAWSAssumeRole }}
# aws-region: ${{ inputs.Region }}

- name: Cache binaries
id: cached_binaries
uses: actions/cache@v3
with:
key: "cached_binaries_${{ github.sha }}_${{ inputs.PackageBucketKey }}_${{ inputs.Bucket }}_${{ inputs.BucketKey }}"
path: go.mod

- name: Cache go
# Only skip for integration builds not release builds.
if: contains(inputs.BucketKey, 'test') == false || steps.cached_binaries.outputs.cache-hit == false
uses: actions/cache@v3
with:
path: |
~/go/pkg/mod
~/.cache/go-build
key: v1-go-pkg-mod-${{ runner.os }}-${{ hashFiles('**/go.sum') }}
# - name: Cache binaries
# id: cached_binaries
# uses: actions/cache@v3
# with:
# key: "cached_binaries_${{ github.sha }}_${{ inputs.PackageBucketKey }}_${{ inputs.Bucket }}_${{ inputs.BucketKey }}"
# path: go.mod
#
# - name: Cache go
# # Only skip for integration builds not release builds.
# if: contains(inputs.BucketKey, 'test') == false || steps.cached_binaries.outputs.cache-hit == false
# uses: actions/cache@v3
# with:
# path: |
# ~/go/pkg/mod
# ~/.cache/go-build
# key: v1-go-pkg-mod-${{ runner.os }}-${{ hashFiles('**/go.sum') }}

- name: Import GPG Key
if: contains(inputs.BucketKey, 'test') == false || steps.cached_binaries.outputs.cache-hit == false
# if: contains(inputs.BucketKey, 'test') == false || steps.cached_binaries.outputs.cache-hit == false
uses: crazy-max/ghaction-import-gpg@v5
with:
gpg_private_key: ${{ secrets.GPG_PRIVATE_KEY }}
passphrase: ${{ secrets.PASSPHRASE }}

- name: Build Binaries
if: contains(inputs.BucketKey, 'test') == false || steps.cached_binaries.outputs.cache-hit == false
run: make amazon-cloudwatch-agent-linux amazon-cloudwatch-agent-windows package-rpm package-deb package-win

- name: Sign Build Files
if: contains(inputs.BucketKey, 'test') == false || steps.cached_binaries.outputs.cache-hit == false
run: for f in $(find build/bin/); do if [ ! -d $f ]; then echo "Signing file $f" && gpg --detach-sign $f ; fi ; done
- name: Show GPG Keys
run: gpg --show-keys

- name: List GPG Info
run: gpg --list-packets

- name: Upload to s3
if: contains(inputs.BucketKey, 'test') == false || steps.cached_binaries.outputs.cache-hit == false
# Copy the RPM to .../amazon_linux/... because BETA customers expect it there.
run: |
echo "BucketKey: ${{ inputs.Bucket }} ${{ inputs.BucketKey }}"
aws s3 cp build/bin s3://${{ inputs.Bucket }}/${{ inputs.BucketKey }} --recursive
aws s3 cp build/bin/linux/amd64/amazon-cloudwatch-agent.rpm s3://${{ inputs.Bucket }}/${{ inputs.BucketKey }}/amazon_linux/amd64/latest/amazon-cloudwatch-agent.rpm
aws s3 cp build/bin/linux/arm64/amazon-cloudwatch-agent.rpm s3://${{ inputs.Bucket }}/${{ inputs.BucketKey }}/amazon_linux/arm64/latest/amazon-cloudwatch-agent.rpm
# - name: Build Binaries
# if: contains(inputs.BucketKey, 'test') == false || steps.cached_binaries.outputs.cache-hit == false
# run: make amazon-cloudwatch-agent-linux amazon-cloudwatch-agent-windows package-rpm package-deb package-win
#
# - name: Sign Build Files
# if: contains(inputs.BucketKey, 'test') == false || steps.cached_binaries.outputs.cache-hit == false
# run: for f in $(find build/bin/); do if [ ! -d $f ]; then echo "Signing file $f" && gpg --detach-sign $f ; fi ; done
#
#
# - name: Upload to s3
# if: contains(inputs.BucketKey, 'test') == false || steps.cached_binaries.outputs.cache-hit == false
# # Copy the RPM to .../amazon_linux/... because BETA customers expect it there.
# run: |
# echo "BucketKey: ${{ inputs.Bucket }} ${{ inputs.BucketKey }}"
# aws s3 cp build/bin s3://${{ inputs.Bucket }}/${{ inputs.BucketKey }} --recursive
# aws s3 cp build/bin/linux/amd64/amazon-cloudwatch-agent.rpm s3://${{ inputs.Bucket }}/${{ inputs.BucketKey }}/amazon_linux/amd64/latest/amazon-cloudwatch-agent.rpm
# aws s3 cp build/bin/linux/arm64/amazon-cloudwatch-agent.rpm s3://${{ inputs.Bucket }}/${{ inputs.BucketKey }}/amazon_linux/arm64/latest/amazon-cloudwatch-agent.rpm

0 comments on commit a4c6a42

Please sign in to comment.