mirror of
https://github.com/IceWhaleTech/CasaOS.git
synced 2025-11-07 15:19:44 +00:00
Merge branch 'main' into add_zertier
Signed-off-by: link <a624669980@163.com>
This commit is contained in:
commit
3db0ff0765
2
.github/workflows/demo.yml
vendored
2
.github/workflows/demo.yml
vendored
@ -33,7 +33,7 @@ jobs:
|
|||||||
|
|
||||||
- name: Get old instance and snapshot name, create new instance name
|
- name: Get old instance and snapshot name, create new instance name
|
||||||
run: |
|
run: |
|
||||||
echo "OLD_INSTANCE_SNAPSHOT_NAME=$(aws lightsail get-instance-snapshots | grep '"name": "updateto_to_0.4.1-1676285322' | sed 's/ //g' | sed 's/"//g' | sed 's/,//g' | sed 's/name://g')" >> $GITHUB_ENV
|
echo "OLD_INSTANCE_SNAPSHOT_NAME=$(aws lightsail get-instance-snapshots | grep '"name": "updateto_to_0.4.4-1684926517' | sed 's/ //g' | sed 's/"//g' | sed 's/,//g' | sed 's/name://g')" >> $GITHUB_ENV
|
||||||
echo "OLD_INSTANCE_NAME=$(aws lightsail get-instances | grep '"name": "CasaOS-Demo-[0-9]' | sed 's/ //g' | sed 's/"//g' | sed 's/,//g' | sed 's/name://g')" >> $GITHUB_ENV
|
echo "OLD_INSTANCE_NAME=$(aws lightsail get-instances | grep '"name": "CasaOS-Demo-[0-9]' | sed 's/ //g' | sed 's/"//g' | sed 's/,//g' | sed 's/name://g')" >> $GITHUB_ENV
|
||||||
echo "NEW_INSTANCE_NAME= CasaOS-Demo-$(date +%s)" >> $GITHUB_ENV
|
echo "NEW_INSTANCE_NAME= CasaOS-Demo-$(date +%s)" >> $GITHUB_ENV
|
||||||
|
|
||||||
|
|||||||
16
.github/workflows/publish_npm.yaml
vendored
16
.github/workflows/publish_npm.yaml
vendored
@ -14,25 +14,33 @@ jobs:
|
|||||||
runs-on: ubuntu-22.04
|
runs-on: ubuntu-22.04
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v3
|
- uses: actions/checkout@v3
|
||||||
|
with:
|
||||||
|
fetch-depth: 0
|
||||||
- uses: actions/setup-node@v3
|
- uses: actions/setup-node@v3
|
||||||
with:
|
with:
|
||||||
node-version: 16
|
node-version: 16
|
||||||
registry-url: https://registry.npmjs.org/
|
registry-url: https://registry.npmjs.org/
|
||||||
|
|
||||||
|
- run: git tag --sort=-creatordate | head -n 1
|
||||||
- name: Get version
|
- name: Get version
|
||||||
id: get_version
|
id: get_version
|
||||||
run: echo ::set-output name=VERSION::${GITHUB_REF/refs\/tags\//}
|
run: echo "VERSION=$(git tag --sort=-creatordate | head -n 1)" >> $GITHUB_OUTPUT
|
||||||
|
- name: Get commit id
|
||||||
|
id: get_commit_id
|
||||||
|
run: echo "COMMIT_ID=$( git rev-parse --short "$GITHUB_SHA" )" >> $GITHUB_OUTPUT
|
||||||
|
|
||||||
|
- run: echo "${{ steps.get_version.outputs.VERSION }}-${{ steps.get_commit_id.outputs.COMMIT_ID }}"
|
||||||
- name: Set version
|
- name: Set version
|
||||||
run: |
|
run: |
|
||||||
sudo apt-get install jq
|
sudo apt-get install jq
|
||||||
jq '.version="${{ steps.get_version.outputs.VERSION }}"' package.json > package.json.new
|
jq '.version="${{ steps.get_version.outputs.VERSION }}-${{ steps.get_commit_id.outputs.COMMIT_ID }}"' package.json > package.json.new
|
||||||
mv package.json.new package.json
|
mv package.json.new package.json
|
||||||
- name: Generate SDK
|
- name: Generate SDK
|
||||||
run: |
|
run: |
|
||||||
npm cache clean --force
|
npm cache clean --force
|
||||||
npm install @openapitools/openapi-generator-cli -g
|
npm install @openapitools/openapi-generator-cli -g
|
||||||
make build
|
|
||||||
- run: npm i
|
- run: npm i
|
||||||
- run: npm run start
|
- run: npm run start
|
||||||
- run: npm publish -W
|
- run: npm publish --access public
|
||||||
env:
|
env:
|
||||||
NODE_AUTH_TOKEN: ${{secrets.npm_token}}
|
NODE_AUTH_TOKEN: ${{secrets.npm_token}}
|
||||||
|
|||||||
@ -1,6 +1,7 @@
|
|||||||
{
|
{
|
||||||
"name": "@icewhale/casaos-openapi",
|
"name": "@icewhale/casaos-openapi",
|
||||||
"version": "0.0.1",
|
"version": "0.0.1",
|
||||||
|
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"clean": "rm -rf generate",
|
"clean": "rm -rf generate",
|
||||||
"build": "rm -rf dist && tsc && yarn clean",
|
"build": "rm -rf dist && tsc && yarn clean",
|
||||||
|
|||||||
@ -30,7 +30,6 @@ func (s *CasaOS) SetZerotierNetworkStatus(ctx echo.Context, networkId string) er
|
|||||||
fmt.Println(err)
|
fmt.Println(err)
|
||||||
return ctx.JSON(http.StatusInternalServerError, codegen.BaseResponse{Message: utils.Ptr(err.Error())})
|
return ctx.JSON(http.StatusInternalServerError, codegen.BaseResponse{Message: utils.Ptr(err.Error())})
|
||||||
}
|
}
|
||||||
fmt.Println(string(res))
|
|
||||||
info := codegen.GetZTInfoOK{}
|
info := codegen.GetZTInfoOK{}
|
||||||
via := gjson.GetBytes(res, "routes.0.via").Str
|
via := gjson.GetBytes(res, "routes.0.via").Str
|
||||||
info.Id = utils.Ptr(gjson.GetBytes(res, "id").Str)
|
info.Id = utils.Ptr(gjson.GetBytes(res, "id").Str)
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user