Version, dry-run:false #12
This file contains hidden or 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 | |
run-name: Version, dry-run:${{ inputs.dryrun }} | |
on: | |
workflow_dispatch: | |
inputs: | |
dryrun: | |
description: 'Dry run' | |
required: false | |
default: false | |
type: boolean | |
confirm: | |
description: 'Confirm version push (yes/no)' | |
required: false | |
default: 'no' | |
type: string | |
jobs: | |
version: | |
name: 🏷️ Version | |
runs-on: ubuntu-24.04 | |
permissions: | |
# create commits and releases | |
contents: write | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
with: | |
# fetch tags | |
fetch-depth: 0 | |
# the repository's remote URL is configured to use the PAT | |
# for subsequent Git operations (e.g., git push). | |
# https://github.com/settings/personal-access-tokens | |
token: ${{ secrets.PAT_TOKEN }} | |
- name: Setup Node and Install Dependencies | |
uses: ./.github/actions/setup-install | |
- name: Setup git config | |
run: | | |
git config user.name "${{ github.actor }}" | |
git config user.email "[email protected]" | |
- name: List affected packages | |
run: | | |
yarn packages:changed | |
- name: Build | |
run: | | |
make build | |
- name: Dry run | |
if: ${{ github.event.inputs.dryrun == 'true' }} | |
run: | | |
yarn lerna version --no-push --no-git-tag-version --yes | |
git diff | |
- name: Bump version | |
if: ${{ github.event.inputs.dryrun == 'false' }} | |
env: | |
GH_TOKEN: ${{ secrets.PAT_TOKEN }} | |
run: | | |
make version | |
git --no-pager show --stat --patch HEAD | |
- name: Push version | |
if: ${{ github.event.inputs.dryrun == 'false' }} | |
run: | | |
if [ "${{ github.event.inputs.confirm }}" != "yes" ]; then | |
echo "Version process aborted." | |
exit 1 | |
else | |
echo "Proceeding with the version push..." | |
git push && git push --tags | |
fi |