You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

113 lines
3.4 KiB

kind: pipeline
type: docker
name: windows打包exe
host_aliases:
- ip: 192.168.0.2
hostnames:
- git.1000my.com
clone:
pull: if-not-exists
depth: 1
trigger:
branch:
- master
- test
event:
- push
volumes:
- name: dockersock
host:
path: /data/drone/docker/sock
- name: gitea
host:
path: /gitea
steps:
- name: 生成Release版本
pull: if-not-exists
image: registry.cn-hangzhou.aliyuncs.com/tgabc-namespace/tgabc:semantic-release-v21.0.1
volumes:
- name: gitea
path: /root/.ssh/id_rsa
environment:
GITEA_TOKEN:
from_secret: gitea_token
settings:
git_login:
from_secret: gitea_username
git_password:
from_secret: gitea_password
commands:
- echo 192.168.0.2 git.1000my.com >> /etc/hosts
- semantic-release
- name: 获取tag数据
image: registry.cn-hangzhou.aliyuncs.com/qmiot/init:alpine-git-v2.36.2
commands:
- ping git.1000my.com -c 1
- echo 192.168.0.2 git.1000my.com >> /etc/hosts
- ping git.1000my.com -c 1
- git fetch --tags
- git submodule init
- git submodule update --recursive --remote
# - git submodule add -b master https://git.1000my.com/project_runteng/server_iot-common.git
# - git mv server_iot-common iot-common
# - git submodule sync
- git describe --tags `git rev-list --tags --max-count=1`
# 获取当前分支的tag
- git describe --abbrev=0 --tags > .tags
- cat .tags
- name: 编译
pull: if-not-exists
image: registry.cn-hangzhou.aliyuncs.com/qmiot/init:nsis20241212
commands:
- makensis Sources/nbn.nsi
- ls Sources/Setup.exe
- du -sh Sources/Setup.exe
# zip打包
- zip_name=$DRONE_REPO_NAME.$(cat .tags).zip
- cd ./Sources
- zip -q -r $zip_name ./
- ls $zip_name
- ls
- pwd
when:
branch:
- test
- name: 上传exe和zip到iot测试接口platformAppAdd
pull: if-not-exists
image: registry.cn-hangzhou.aliyuncs.com/qmiot/init:apisix-init-base
environment:
url_for_iotplatform: 'http://192.168.0.142:31667'
url_for_iotfile: 'http://192.168.0.142:31666'
logo: '/drone/src/logo.jpg'
cdn_url: 'https://test-598d.1000my.com'
# genre: "Samsung"
commands:
# # 自动授权
# - export projectCode="projectCode=project-inluar4ppcxvciefgb_ila"
- export isiot="True" # 要不要传iot
- export name="windows打包_测试版" # 应用名称(自行填写 必填)
- export version=$(cat .tags) # 应用版本
- export sourceId="8" # 应用来源id(默认为8 即测试环境专用) //如需更改查看测试环境平台级下应用管理新增应用的/api/platform/v1/platformProgram/platformProgramAdd接口
- export genre="localpack" # 应用类型 本地资源包 [outchain, localpack]
- export resolution="2160*3840竖屏" # 分辨率(自行填写)[1080*1920竖屏, 1920*1080横屏, 3840*2160横屏, 2160*3840竖屏]
- export package="/drone/src/target/Sources/Setup.exe" # 包名称
- export des=$CI_COMMIT_MESSAGE # 应用描述
- python3 iot_upload.py
- export package="$DRONE_REPO_NAME.$(cat .tags).zip" # 包名称
- python3 iot_upload.py
when:
branch:
- test