mirror of
https://github.com/jdx/mise-action.git
synced 2026-05-14 22:00:34 +00:00
chore: get postversion to work
This commit is contained in:
parent
bd8ba20c56
commit
954e13db3e
3 changed files with 7 additions and 16 deletions
1
.github/workflows/release-plz.yml
vendored
1
.github/workflows/release-plz.yml
vendored
|
|
@ -30,4 +30,5 @@ jobs:
|
|||
- uses: jdx/mise-action@v2
|
||||
- run: mise run release-plz
|
||||
env:
|
||||
DRY_RUN: 0
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
|
|
|
|||
|
|
@ -25,7 +25,6 @@
|
|||
"package": "ncc build -s src/index.ts --license licenses.txt",
|
||||
"package:watch": "npm run package -- --watch",
|
||||
"version": "./scripts/version.sh",
|
||||
"postversion": "./scripts/postversion.sh",
|
||||
"prepare": "husky"
|
||||
},
|
||||
"license": "MIT",
|
||||
|
|
|
|||
|
|
@ -7,36 +7,27 @@ cur_version="$(jq -r .version package.json)"
|
|||
|
||||
# Check if this version has already been released
|
||||
released_versions="$(git tag --list | grep -E '^v[0-9]+\.[0-9]+\.[0-9]+(-rc\.[0-9]+)?$')"
|
||||
if echo "$released_versions" | grep -q "^v$cur_version$"; then
|
||||
echo "Version $cur_version already released"
|
||||
exit 0
|
||||
if ! echo "$released_versions" | grep -q "^v$cur_version$"; then
|
||||
git tag -d "v$cur_version"
|
||||
node ./scripts/postversion.sh
|
||||
fi
|
||||
|
||||
# Get the next version and changelog from git-cliff
|
||||
version="$(git cliff --bumped-version)"
|
||||
changelog="$(git cliff --bump --unreleased --strip all)"
|
||||
|
||||
if [ "${MISE_DRY_RUN:-}" == 1 ]; then
|
||||
if [ "${DRY_RUN:-1}" == 1 ]; then
|
||||
echo "version: $version"
|
||||
echo "changelog: $changelog"
|
||||
exit 0
|
||||
fi
|
||||
|
||||
# Update changelog
|
||||
git cliff --bump -o CHANGELOG.md
|
||||
|
||||
# Update package.json version
|
||||
npm version "${version#v}" --no-git-tag
|
||||
|
||||
# Build the project
|
||||
npm run all
|
||||
|
||||
# Configure git for automated commits
|
||||
git config user.name mise-en-dev
|
||||
git config user.email 123107610+mise-en-dev@users.noreply.github.com
|
||||
|
||||
# Add all changes
|
||||
git add package.json package-lock.json CHANGELOG.md dist/
|
||||
# Update package.json version
|
||||
npm version "${version#v}" --no-git-tag-version
|
||||
|
||||
# Create release branch and commit
|
||||
git checkout -B release
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue