Skip to content

Commit

Permalink
fix(build): bump version order
Browse files Browse the repository at this point in the history
  • Loading branch information
andreszorro committed Jul 15, 2024
1 parent 03029fb commit fd22d6e
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 28 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/release.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Test, Build and Release
name: Tool Release

on:
push:
Expand Down
14 changes: 13 additions & 1 deletion .github/workflows/test-build.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Test
name: Test and build

on:
workflow_call:
Expand Down Expand Up @@ -31,6 +31,8 @@ jobs:
needs: test
name: build-${{matrix.name}}
runs-on: ${{matrix.runs-on}}
permissions:
contents: write
strategy:
fail-fast: false
matrix:
Expand Down Expand Up @@ -61,6 +63,16 @@ jobs:
cache: true
experimental: true
- run: bun install
- name: Bump version
if: startsWith(github.ref, 'refs/tags/')
run: |
version=$(echo ${{ github.ref }} | sed -e s%refs/tags/%%)
echo "New tag found. Updating package.json to $version..."
jq --indent 4 '.version = $version' package.json > package.json.tmp
mv package.json.tmp package.json
bun biome format --write package.json
git add package.json
git commit -m "[skip ci]: Bump version $version"
- name: Create binary and release files
run: |
jq -r '.version' package.json
Expand Down
25 changes: 1 addition & 24 deletions .husky/pre-push
Original file line number Diff line number Diff line change
@@ -1,26 +1,3 @@
#!/usr/bin/env sh

# shellcheck disable=SC2034
while read lref new rref old
do
case $rref in
refs/tags/*)
if echo "$rref"; then
version=$(echo "$rref" | sed s/.*v//)
tmp_pkg=$(mktemp)
echo "New tag found. Updating package.json to $version..."
echo "Current version: $(jq -r .version ./package.json)"
jq --indent 4 --arg version "$version" '.version = $version' ./package.json > "$tmp_pkg" && mv "$tmp_pkg" ./package.json
bun biome format --write package.json
git add package.json
git commit -m "[skip-ci]: Bump version $version"
exit 0
else
bun branch-name-lint package.json
fi;;
*)
;;
esac
done


bun branch-name-lint package.json
2 changes: 1 addition & 1 deletion commitlint.config.cjs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module.exports = {
extends: ["@commitlint/config-conventional"],
ignores: [(commit) => commit.startsWith("[skip-ci]")],
ignores: [(commit) => commit.startsWith("[skip ci]")],
rules: {
"body-max-line-length": [0, "always", 200],
},
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,6 @@
"releases": "release"
},
"banned": ["wip"],
"skip": ["skip-ci"]
"skip": ["skip ci", "main", "develop"]
}
}

0 comments on commit fd22d6e

Please sign in to comment.