diff --git a/misc/release/pump-version.sh b/misc/release/pump-version.sh index 84f3fa3163..a0b2f0b6cb 100755 --- a/misc/release/pump-version.sh +++ b/misc/release/pump-version.sh @@ -61,26 +61,17 @@ fi if [ "$CURRENT_SERVER" != "$NEXT_SERVER" ]; then echo "Pumping Server: $CURRENT_SERVER => $NEXT_SERVER" + npm --prefix server version $SERVER_PUMP + npm --prefix server run api:generate fi if [ "$CURRENT_MOBILE" != "$NEXT_MOBILE" ]; then echo "Pumping Mobile: $CURRENT_MOBILE => $NEXT_MOBILE" fi -sed -i "s/^ \"version\": \"$CURRENT_SERVER\",$/ \"version\": \"$NEXT_SERVER\",/" server/package.json -sed -i "s/^ \"version\": \"$CURRENT_SERVER\",$/ \"version\": \"$NEXT_SERVER\",/" server/package-lock.json -sed -i "s/\"version\": \"$CURRENT_SERVER\",$/\"version\": \"$NEXT_SERVER\",/" server/immich-openapi-specs.json sed -i "s/\"android\.injected\.version\.name\" => \"$CURRENT_SERVER\",/\"android\.injected\.version\.name\" => \"$NEXT_SERVER\",/" mobile/android/fastlane/Fastfile sed -i "s/version_number: \"$CURRENT_SERVER\"$/version_number: \"$NEXT_SERVER\"/" mobile/ios/fastlane/Fastfile sed -i "s/\"android\.injected\.version\.code\" => $CURRENT_MOBILE,/\"android\.injected\.version\.code\" => $NEXT_MOBILE,/" mobile/android/fastlane/Fastfile sed -i "s/^version: $CURRENT_SERVER+$CURRENT_MOBILE$/version: $NEXT_SERVER+$NEXT_MOBILE/" mobile/pubspec.yaml -# OpenApi Generated Files -sed -i "s/API version: $CURRENT_SERVER,$/API version: $NEXT_SERVER/" mobile/openapi/README.md -sed -i "s/OpenAPI document: $CURRENT_SERVER,$/OpenAPI document: $NEXT_SERVER/" web/src/api/open-api/api.ts -sed -i "s/OpenAPI document: $CURRENT_SERVER,$/OpenAPI document: $NEXT_SERVER/" web/src/api/open-api/base.ts -sed -i "s/OpenAPI document: $CURRENT_SERVER,$/OpenAPI document: $NEXT_SERVER/" web/src/api/open-api/common.ts -sed -i "s/OpenAPI document: $CURRENT_SERVER,$/OpenAPI document: $NEXT_SERVER/" web/src/api/open-api/configuration.ts -sed -i "s/OpenAPI document: $CURRENT_SERVER,$/OpenAPI document: $NEXT_SERVER/" web/src/api/open-api/index.ts - echo "IMMICH_VERSION=v$NEXT_SERVER" >>$GITHUB_ENV diff --git a/server/bin/sync-spec-version.js b/server/bin/sync-spec-version.js new file mode 100644 index 0000000000..8de54b64bb --- /dev/null +++ b/server/bin/sync-spec-version.js @@ -0,0 +1,6 @@ +const spec = require('../immich-openapi-specs.json'); +const pkg = require('../package.json'); +const path = require('path'); +const fs = require('fs'); +spec.info.version = pkg.version; +fs.writeFileSync(path.join(__dirname, '../immich-openapi-specs.json'), JSON.stringify(spec, null, 2)); diff --git a/server/package.json b/server/package.json index 4580cd5f82..7ae66290e8 100644 --- a/server/package.json +++ b/server/package.json @@ -37,7 +37,7 @@ "typeorm:schema:reset": "npm run typeorm:schema:drop && npm run typeorm:migrations:run", "api:typescript": "bash ./bin/generate-open-api.sh web", "api:dart": "bash ./bin/generate-open-api.sh mobile", - "api:generate": "bash ./bin/generate-open-api.sh" + "api:generate": "node ./bin/sync-spec-version.js && bash ./bin/generate-open-api.sh" }, "dependencies": { "@babel/runtime": "^7.20.13",