chore: change versioning strategy

This commit is contained in:
2026-03-24 15:38:49 +01:00
parent 816369bf98
commit 92283fdadb

View File

@@ -21,15 +21,16 @@ jobs:
run: | run: |
VERSION=${GITHUB_REF_NAME#v} VERSION=${GITHUB_REF_NAME#v}
echo "Setting package version to $VERSION" echo "Setting package version to $VERSION"
git fetch origin main
git checkout main
npm pkg set version="$VERSION" npm pkg set version="$VERSION"
git config user.name "versioning" SHA=$(curl -s -H "Authorization: token ${GITEA_TOKEN}" \
git config user.email "versioning@blassanto.me" "https://git.blassanto.me/api/v1/repos/blas/openapi-clean-arch-gen/contents/package.json?ref=main" \
git remote set-url origin https://x-token:${GITEA_TOKEN}@git.blassanto.me/blas/openapi-clean-arch-gen.git | node -e "let d='';process.stdin.on('data',c=>d+=c).on('end',()=>console.log(JSON.parse(d).sha))")
git add package.json CONTENT=$(base64 -w 0 package.json)
git commit -m "chore: bump to version v${VERSION}" curl -s -X PUT \
git push origin main -H "Authorization: token ${GITEA_TOKEN}" \
-H "Content-Type: application/json" \
"https://git.blassanto.me/api/v1/repos/blas/openapi-clean-arch-gen/contents/package.json" \
-d "{\"message\":\"chore: bump to version v${VERSION}\",\"content\":\"${CONTENT}\",\"sha\":\"${SHA}\",\"branch\":\"main\"}"
env: env:
GITEA_TOKEN: ${{ secrets.TOKEN }} GITEA_TOKEN: ${{ secrets.TOKEN }}