Skip to content

Commit

Permalink
Merge pull request #140 from MacPaw/feat/add-signed-commits-for-autom…
Browse files Browse the repository at this point in the history
…ated-releases

feat: add signed commits for automated releases
  • Loading branch information
wallwhite authored Oct 3, 2023
2 parents 9f8497e + 6f90641 commit aeb2b70
Show file tree
Hide file tree
Showing 5 changed files with 39 additions and 1 deletion.
5 changes: 5 additions & 0 deletions .changeset/tidy-cheetahs-deny.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@macpaw/macpaw-ui": patch
---

Changes to trigger patch release for testing that auto release is working well
20 changes: 20 additions & 0 deletions .github/actions/github-config/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
name: 'github config'
description: 'Update GIT config with signing key'
inputs:
gpg-key-base64:
description: 'Base64 GPG key'
required: true
runs:
using: "composite"
steps:
- run: |
mkdir -p ${GITHUB_WORKSPACE}/.gpg
echo ${{ inputs.gpg-key-base64 }} | base64 -d > ${GITHUB_WORKSPACE}/.gpg/private.key
gpg --import ${GITHUB_WORKSPACE}/.gpg/private.key
git config --global user.signingkey <user-signingkey>
git config --global commit.gpgsign true
git config user.name ci-macpaw
git config user.email [email protected]
shell: bash
name: Update git config
11 changes: 10 additions & 1 deletion .github/actions/release/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,13 +29,21 @@ inputs:
description: 'The command to use to release'
required: false
default: 'release'
gpg-key-base64:
description: 'The base64 encoded GPG key to use'
required: true
outputs:
release-ready:
description: "Random number"
value: ${{ steps.output-generator.outputs.release-ready }}
runs:
using: composite
steps:
steps:
- name: Configure git user
uses: ./.github/actions/github-config
with:
gpg-key-base64: ${{ inputs.gpg-key-base64 }}

- name: Prepare node
uses: ./.github/actions/prepare-node
id: prepare-node
Expand All @@ -52,6 +60,7 @@ runs:
publish: ${{ inputs.package-manager == 'npm' && format('npm run {0}', inputs.release-command) || format('{0} {1}', inputs.package-manager, inputs.release-command) }}
title: ${{ inputs.release-pr-title }}
commit: ${{ inputs.release-commit-message }}
setupGitUser: false
env:
GITHUB_TOKEN: ${{ inputs.github-token }}

Expand Down
1 change: 1 addition & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ jobs:
release-commit-message: 'chore(release): version update for packages'
github-token: ${{ secrets.GITHUB_TOKEN }}
release-command: 'changes:release'
gpg-key-base64: ${{ secrets.CI_GITHUB_GPG_KEY_BASE64 }}

- name: Generate outputs
id: releaseOutputs
Expand Down
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -18,3 +18,6 @@ out

# VS code setting
**/.vscode/*

# GPG key
.gpg

0 comments on commit aeb2b70

Please sign in to comment.