Skip to content

Commit

Permalink
ci: allow prereleases on publish workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
mvidalgarcia committed Jan 4, 2024
1 parent e6157ea commit 3ad5beb
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 3 deletions.
18 changes: 16 additions & 2 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
name: Publish
run-name: Publish, prerelease:${{ inputs.prerelease }}, dry-run:${{ inputs.dryrun }}

on:
workflow_dispatch:
Expand All @@ -8,6 +9,11 @@ on:
required: false
default: false
type: boolean
prerelease:
description: "Prerelease"
required: false
default: false
type: boolean

jobs:
publish:
Expand Down Expand Up @@ -41,7 +47,11 @@ jobs:
- name: Dry run
if: ${{ github.event.inputs.dryrun == 'true' }}
run: |
yarn lerna version --no-private --no-push --no-git-tag-version --yes
if ${{ github.event.inputs.prerelease == 'true' }}; then
yarn lerna version --no-private --no-push --no-git-tag-version --conventional-prerelease --yes
else
yarn lerna version --no-private --no-push --no-git-tag-version --yes
fi
git diff
yarn zx scripts/post-changelog.mjs --dry
Expand All @@ -56,7 +66,11 @@ jobs:
echo "access=public" >> ~/.npmrc
echo "//registry.npmjs.org/:_authToken=$NPM_TOKEN" >> ~/.npmrc
echo "//registry.npmjs.org/:always-auth=true" >> ~/.npmrc
yarn lerna publish --no-private --conventional-commits --create-release github --ignore-prepublish --yes
if ${{ github.event.inputs.prerelease == 'true' }}; then
yarn lerna publish --no-private --conventional-commits --create-release github --ignore-prepublish --conventional-prerelease --yes
else
yarn lerna publish --no-private --conventional-commits --create-release github --ignore-prepublish --yes
fi
yarn docs changelog
git add docs/src/data/log.md && git commit -m "docs: update changelog" && git push
yarn zx scripts/post-changelog.mjs
2 changes: 1 addition & 1 deletion lerna.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"packages": ["packages/*", "docs"],
"command": {
"version": {
"allowBranch": "master",
"allowBranch": ["master"],
"message": "chore: publish",
"conventionalCommits": true
},
Expand Down

0 comments on commit 3ad5beb

Please sign in to comment.