Merge pull request #292 from thefrontside/cl/push-signed-commit #6
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Version Or Release | |
on: | |
push: | |
branches: | |
- main | |
jobs: | |
version-or-publish: | |
runs-on: ubuntu-latest | |
timeout-minutes: 65 | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
token: ${{ secrets.FRONTSIDEJACK_GITHUB_TOKEN }} | |
fetch-depth: 0 # required for use of git history | |
- uses: actions/setup-node@v3 | |
with: | |
registry-url: "https://registry.npmjs.org" | |
- name: Commit Signing | |
uses: crazy-max/ghaction-import-gpg@v6 | |
with: | |
gpg_private_key: ${{ secrets.FRONTSIDEJACK_GPG_KEY }} | |
passphrase: ${{ secrets.FRONTSIDEJACK_GPG_KEY_PASSPHRASE }} | |
git_user_signingkey: true | |
git_commit_gpgsign: true | |
- name: covector version or publish (publish when no change files present) | |
uses: jbolda/covector/packages/action@covector-v0.12 | |
id: covector | |
with: | |
token: ${{ secrets.FRONTSIDEJACK_GITHUB_TOKEN }} | |
command: "version-or-publish" | |
recognizeContributors: true | |
# recommit with the signature setup in the beginning of this action | |
- name: Sign Commits | |
if: steps.covector.outputs.commandRan == 'version' | |
run: | | |
git commit --amend --no-edit --reset-author | |
git push --force-with-lease origin release | |
- name: Create Pull Request With Versions Bumped | |
uses: peter-evans/create-pull-request@v6 | |
if: steps.covector.outputs.commandRan == 'version' | |
with: | |
token: ${{ secrets.FRONTSIDEJACK_GITHUB_TOKEN }} | |
title: "Publish New Versions" | |
commit-message: "publish new versions" | |
labels: "version updates" | |
branch: "release" | |
body: ${{ steps.covector.outputs.change }} | |
- name: Push Git Tags | |
# through the actions/checkout token, this will use the frontsidejack token | |
if: steps.covector.outputs.commandRan == 'publish' | |
run: git push --tags |