This commit is contained in:
parent
f01eb56097
commit
52b8e57fc7
@ -1,34 +1,40 @@
|
|||||||
name: TDevOPsCICD
|
name: TDevOPsCICD
|
||||||
|
|
||||||
on: [push]
|
on: [push]
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build-image:
|
build-image:
|
||||||
runs-on: workbench
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: https://gitea.com/actions/checkout@v4
|
- uses: https://gitea.com/actions/checkout@v4
|
||||||
- name: Build Binary
|
- name: Setup Bun
|
||||||
env:
|
run: |
|
||||||
OBJECT_TOKEN: ${{ secrets.OBJECT_TOKEN }} # 需要在Gitea项目设置中配置的密钥
|
curl -fsSL https://bun.sh/install | bash
|
||||||
GITEA_BASE_URL: http://git.honor3.com # 你的Gitea实例地址
|
export BUN_INSTALL="$HOME/.bun"
|
||||||
PACKAGE_OWNER: Fullstack # 仓库所有者用户名
|
export PATH="$BUN_INSTALL/bin:$PATH"
|
||||||
REPO_NAME: kit.program # 仓库名
|
echo "BUN_INSTALL=$HOME/.bun" >> $GITHUB_ENV
|
||||||
PACKAGE_NAME: kit
|
echo "$HOME/.bun/bin" >> $GITHUB_PATH
|
||||||
PACKAGE_VERSION: ${{ github.ref_name }} # 使用分支名或标签作为版本
|
- name: Build Binary
|
||||||
run: |
|
env:
|
||||||
echo ----------------------------------------
|
OBJECT_TOKEN: ${{ secrets.OBJECT_TOKEN }}
|
||||||
echo ${{ github.ref_name }} ${{ github.sha }}
|
GITEA_BASE_URL: http://git.honor3.com
|
||||||
bun -v
|
PACKAGE_OWNER: Fullstack
|
||||||
ping -c 3 git.honor3.com
|
REPO_NAME: kit.program
|
||||||
cd kit
|
PACKAGE_NAME: kit
|
||||||
bun i
|
PACKAGE_VERSION: ${{ github.ref_name }}
|
||||||
bun run windows
|
run: |
|
||||||
curl -X POST \
|
echo ----------------------------------------
|
||||||
-H "Authorization: token $OBJECT_TOKEN" \
|
echo ${{ github.ref_name }} ${{ github.sha }}
|
||||||
-F "data=@./dist/windows/kit.exe" \
|
bun -v
|
||||||
"$GITEA_BASE_URL/api/packages/$PACKAGE_OWNER/generic/$REPO_NAME/$PACKAGE_VERSION/kit.exe"
|
cd kit
|
||||||
bun run linux
|
bun i
|
||||||
curl -X POST \
|
bun run windows
|
||||||
-H "Authorization: token $OBJECT_TOKEN" \
|
curl -X POST \
|
||||||
-F "data=@./dist/linux/kit" \
|
-H "Authorization: token $OBJECT_TOKEN" \
|
||||||
"$GITEA_BASE_URL/api/packages/$PACKAGE_OWNER/generic/$REPO_NAME/$PACKAGE_VERSION/kit"
|
-F "data=@./dist/windows/kit.exe" \
|
||||||
|
"$GITEA_BASE_URL/api/packages/$PACKAGE_OWNER/generic/$REPO_NAME/$PACKAGE_VERSION/kit.exe"
|
||||||
|
bun run linux
|
||||||
|
curl -X POST \
|
||||||
|
-H "Authorization: token $OBJECT_TOKEN" \
|
||||||
|
-F "data=@./dist/linux/kit" \
|
||||||
|
"$GITEA_BASE_URL/api/packages/$PACKAGE_OWNER/generic/$REPO_NAME/$PACKAGE_VERSION/kit"
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user