Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Option for prereleases #8

Merged
merged 4 commits into from
Feb 24, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 11 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,16 +41,17 @@ steps:
There are a few parameters that can be set to customize the behavior of the
action, they are all optional.

| Parameter | Default | Description |
|-----------------|-----------------------|----------------------------------------------------------|
| melos-version | latest | The version of Melos to activate. |
| run-bootstrap | true | Whether to run `melos bootstrap` after activating Melos. |
| run-versioning | false | Whether packages should be versioned. |
| publish-dry-run | false | Whether packages should be dry-run published. |
| publish | false | Whether packages should be published to pub.dev. |
| create-pr | false | Whether to create a PR with the changes made by Melos. |
| git-email | contact@blue-fire.xyz | The email to use when committing changes. |
| git-name | Melos Action | The name to use when committing changes. |
| Parameter | Default | Description |
|---------------------------|-----------------------|----------------------------------------------------------|
| melos-version | latest | The version of Melos to activate. |
| run-bootstrap | true | Whether to run `melos bootstrap` after activating Melos. |
| run-versioning | false | Whether packages should be versioned. |
| run-versioning-prerelease | false | Whether packages should be versioned as a prerelease. |
| publish-dry-run | false | Whether packages should be dry-run published. |
| publish | false | Whether packages should be published to pub.dev. |
| create-pr | false | Whether to create a PR with the changes made by Melos. |
| git-email | contact@blue-fire.xyz | The email to use when committing changes. |
| git-name | Melos Action | The name to use when committing changes. |

To set a specific parameter you use the `with` keyword in your action, like in
the example below.
Expand Down
12 changes: 10 additions & 2 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,10 @@ inputs:
description: 'Whether packages should be versioned (default: false)'
required: false
default: 'false'
run-versioning-prerelease:
description: 'Whether packages should be versioned as a prerelease (default: false)'
required: false
default: 'false'
publish-dry-run:
description: 'Whether packages should be dry-run published (default: false)'
required: false
Expand Down Expand Up @@ -54,15 +58,19 @@ runs:
run: command -v melos || echo "$HOME/.pub-cache/bin" >> $GITHUB_PATH
shell: bash
- name: 'Set up git config for email and name'
if: ${{ inputs.publish == 'true' || inputs.run-versioning == 'true' }}
if: ${{ inputs.publish == 'true' || inputs.run-versioning == 'true' || inputs.run-versioning-prerelease == 'true' }}
run: |
git config --global user.email "${{ inputs.git-email }}"
git config --global user.name "${{ inputs.git-name }}"
shell: bash
- name: 'Run melos version (dry run)'
- name: 'Run melos version'
if: ${{ inputs.run-versioning == 'true' }}
run: melos version --yes --no-git-tag-version
shell: bash
- name: 'Run melos version as a prerelease'
if: ${{ inputs.run-versioning-prerelease == 'true' }}
run: melos version --yes --no-git-tag-version --prerelease
shell: bash
- name: 'Run melos publish (dry run)'
if: ${{ inputs.publish-dry-run == 'true' }}
run: melos publish -y --dry-run
Expand Down