0
Fork 0
mirror of https://github.com/logto-io/logto.git synced 2024-12-16 20:26:19 -05:00
logto/.github/workflows/changesets.yml
renovate[bot] 4f4fbe5076
chore(deps): update pnpm to v8 (#3628)
* chore(deps): update pnpm to v8

* ci: update workflow

---------

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Gao Sun <gao@silverhand.io>
2023-03-30 18:51:20 +08:00

73 lines
2.3 KiB
YAML

name: Changesets
on:
workflow_dispatch:
inputs:
releaseGroup:
description: 'The release group to bump version and create pull request'
required: true
type: choice
# This should be synced with `/.scripts/version.js`
options:
- core
- toolkit
pull_request:
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
jobs:
changesets:
strategy:
matrix:
# Multiline expression https://stackoverflow.com/a/67532120/12514940
group: |-
${{
github.event_name == 'pull_request' &&
fromJSON('["core", "toolkit"]') ||
fromJSON(format('["{0}"]', inputs.releaseGroup))
}}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
token: ${{ secrets.BOT_PAT }}
- name: Setup Node and pnpm
uses: silverhand-io/actions-node-pnpm-run-steps@v3
- 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
git_tag_gpgsign: true
- name: Configure Git user
run: |
git config --global user.email bot@silverhand.io
git config --global user.name silverhand-bot
- name: Version packages
run: |
node .scripts/version.js ${{ matrix.group }}
pnpm i --no-frozen-lockfile
git status
- name: Create pull request
if: github.event_name == 'workflow_dispatch'
uses: peter-evans/create-pull-request@v4
with:
token: ${{ secrets.BOT_PAT }}
commit-message: 'release: version ${{ matrix.group }} packages'
committer: silverhand-bot <bot@silverhand.io>
author: silverhand-bot <bot@silverhand.io>
base: master
branch: release/version-${{ matrix.group }}-packages
title: 'release: version ${{ matrix.group }} packages'
body: 'This is an automatic pull request from the result of `node .scripts/version.js ${{ matrix.group }}` command. Merge it will trigger the publish flow for versioned packages.'