Skip to content

Commit

Permalink
build: 👷 replace standard-version with commit-and-tag-version
Browse files Browse the repository at this point in the history
Signed-off-by: Manuel Ruck <[email protected]>
  • Loading branch information
Manuel Ruck committed Oct 17, 2023
1 parent 81573a5 commit ed07e93
Show file tree
Hide file tree
Showing 4 changed files with 622 additions and 1,195 deletions.
19 changes: 8 additions & 11 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -107,25 +107,22 @@ jobs:
changelog=''
if ( ${{ inputs.releaseVersion == 'auto' }} ); then
changelog=`pnpm dlx standard-version --path . -t $MATRIX_PACKAGE@v --dry-run | sed -n '/^---$/,/^---$/p' | grep -v '^---$'`
changelog=`pnpm dlx commit-and-tag-version --path . -t $MATRIX_PACKAGE@v --dry-run | sed -n '/^---$/,/^---$/p' | grep -v '^---$'`
else
changelog=`pnpm dlx standard-version --path . -t $MATRIX_PACKAGE@v --release-as '${{ inputs.releaseVersion }}' --dry-run | sed -n '/^---$/,/^---$/p' | grep -v '^---$'`
changelog=`pnpm dlx commit-and-tag-version --path . -t $MATRIX_PACKAGE@v --release-as '${{ inputs.releaseVersion }}' --dry-run | sed -n '/^---$/,/^---$/p' | grep -v '^---$'`
fi
changelog="${changelog//'%'/'%25'}"
changelog="${changelog//$'\n'/'%0A'}"
changelog="${changelog//$'\r'/'%0D'}"
echo "$changelog"
echo "changelog=$changelog" >> $GITHUB_OUTPUT
echo "${{ matrix.package }} v$changelog" >> $GITHUB_STEP_SUMMARY
echo "{${{ matrix.package }} v$changelog}" >> $GITHUB_STEP_SUMMARY
working-directory: ${{ steps.get-directory.outputs.directory }}
env:
MATRIX_PACKAGE: ${{ matrix.package }}

- name: Determine next version number
if: inputs.releaseVersion == 'auto'
run: |
nextVersion=`pnpm dlx standard-version --path . -t $MATRIX_PACKAGE@v --dry-run | sed -n '/^---$/,/^---$/p' | grep -P -o '(\d+\.)(\d+\.)(\d)' | head -n 1`
nextVersion=`pnpm dlx commit-and-tag-version --path . -t $MATRIX_PACKAGE@v --dry-run | sed -n '/^---$/,/^---$/p' | grep -P -o '(\d+\.)(\d+\.)(\d)' | head -n 1`
echo "$nextVersion"
echo "NEXT_VERSION=$nextVersion" >> $GITHUB_ENV
working-directory: ${{ steps.get-directory.outputs.directory }}
Expand All @@ -142,24 +139,24 @@ jobs:
if: inputs.dryRun == true
run: |
if ( ${{ inputs.releaseVersion == 'auto' }} ); then
pnpm dlx standard-version --path . -t $MATRIX_PACKAGE@v --dry-run
pnpm dlx commit-and-tag-version --path . -t $MATRIX_PACKAGE@v --dry-run
else
pnpm dlx standard-version --path . -t $MATRIX_PACKAGE@v --release-as '${{ inputs.releaseVersion }}' --dry-run
pnpm dlx commit-and-tag-version --path . -t $MATRIX_PACKAGE@v --release-as '${{ inputs.releaseVersion }}' --dry-run
fi
working-directory: ${{ steps.get-directory.outputs.directory }}
env:
MATRIX_PACKAGE: ${{ matrix.package }}

- name: bump version - AUTOMATIC
if: inputs.dryRun == false && inputs.releaseVersion == 'auto'
run: pnpm dlx standard-version --path . -t $MATRIX_PACKAGE@v
run: pnpm dlx commit-and-tag-version --path . -t $MATRIX_PACKAGE@v
working-directory: ${{ steps.get-directory.outputs.directory }}
env:
MATRIX_PACKAGE: ${{ matrix.package }}

- name: bump version - MANUAL VERSION NO.
if: inputs.dryRun == false && inputs.releaseVersion != 'auto'
run: pnpm dlx standard-version --path . -t $MATRIX_PACKAGE@v --release-as '${{ inputs.releaseVersion }}'
run: pnpm dlx commit-and-tag-version --path . -t $MATRIX_PACKAGE@v --release-as '${{ inputs.releaseVersion }}'
working-directory: ${{ steps.get-directory.outputs.directory }}
env:
MATRIX_PACKAGE: ${{ matrix.package }}
Expand Down
36 changes: 36 additions & 0 deletions .versionrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
{
"types": [
{
"type": "feat",
"section": "🚀 Feature"
},
{
"type": "fix"
},
{
"type": "chore"
},
{
"type": "docs"
},
{
"type": "style"
},
{
"type": "refactor"
},
{
"type": "perf"
},
{
"type": "test"
},
{
"type": "ci",
"section": "👷 CI/CD"
},
{
"type": "build"
}
]
}
1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@
"eslint-plugin-jest": "^27.4.0",
"eslint-plugin-prettier": "^5.0.0",
"prettier": "^3.0.3",
"standard-version": "^9.5.0",
"turbo": "^1.10.14"
}
}
Loading

0 comments on commit ed07e93

Please sign in to comment.