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