2022-07-01 05:47:14 -05:00
|
|
|
name: Publish
|
|
|
|
|
|
|
|
on:
|
|
|
|
workflow_dispatch:
|
|
|
|
inputs:
|
|
|
|
semver:
|
|
|
|
description: Semver bump type
|
|
|
|
required: true
|
|
|
|
preid:
|
|
|
|
description: Pre ID
|
|
|
|
required: true
|
|
|
|
default: alpha
|
2022-07-01 09:39:21 -05:00
|
|
|
append:
|
|
|
|
description: Additional options
|
2022-07-01 05:47:14 -05:00
|
|
|
|
|
|
|
jobs:
|
|
|
|
publish:
|
2022-07-01 09:39:21 -05:00
|
|
|
environment: release
|
2022-07-01 05:47:14 -05:00
|
|
|
runs-on: ubuntu-latest
|
|
|
|
|
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v3
|
|
|
|
with:
|
2022-07-01 23:08:19 -05:00
|
|
|
ref: master
|
2022-07-01 05:47:14 -05:00
|
|
|
fetch-depth: 0
|
|
|
|
token: ${{ secrets.BOT_PAT }}
|
2022-07-01 10:17:05 -05:00
|
|
|
|
|
|
|
- name: Import GPG key
|
|
|
|
uses: crazy-max/ghaction-import-gpg@v5
|
|
|
|
with:
|
|
|
|
gpg_private_key: ${{ secrets.BOT_GPG_KEY }}
|
|
|
|
passphrase: ${{ secrets.BOT_GPG_PASSPHRASE }}
|
|
|
|
git_user_signingkey: true
|
|
|
|
git_commit_gpgsign: true
|
2022-07-01 05:47:14 -05:00
|
|
|
|
|
|
|
- name: Setup Node and pnpm
|
2022-07-19 17:42:42 -05:00
|
|
|
uses: silverhand-io/actions-node-pnpm-run-steps@v1.2.3
|
2022-07-01 05:47:14 -05:00
|
|
|
|
|
|
|
- name: Configure Git user
|
|
|
|
run: |
|
|
|
|
git config --global user.email bot@silverhand.io
|
|
|
|
git config --global user.name silverhand-bot
|
|
|
|
|
|
|
|
- name: Publish to GitHub
|
|
|
|
# add `no-verify-access` due to https://github.com/lerna/lerna/issues/2788
|
|
|
|
run: |
|
2022-07-01 10:17:05 -05:00
|
|
|
pnpm lerna publish \
|
|
|
|
-m "release: %s" \
|
|
|
|
--conventional-commits \
|
|
|
|
--preid=${{ github.event.inputs.preid }} \
|
|
|
|
--no-verify-access \
|
|
|
|
--sign-git-commit \
|
|
|
|
--sign-git-tag \
|
2022-07-01 23:08:19 -05:00
|
|
|
--no-push \
|
2022-07-01 10:17:05 -05:00
|
|
|
--yes \
|
|
|
|
${{ github.event.inputs.semver }} ${{ github.event.inputs.append }}
|
2022-07-01 05:47:14 -05:00
|
|
|
env:
|
|
|
|
GH_TOKEN: ${{ secrets.BOT_PAT }}
|
|
|
|
|
2022-07-01 23:08:19 -05:00
|
|
|
- name: Push to protected branch
|
|
|
|
uses: CasperWA/push-protected@v2
|
2022-07-01 05:47:14 -05:00
|
|
|
with:
|
2022-07-01 23:08:19 -05:00
|
|
|
token: ${{ secrets.BOT_PAT }}
|
|
|
|
branch: master
|
|
|
|
tags: true
|
|
|
|
timeout: 20
|