Some checks failed
CI/CD Pipeline for DevStar Extension / build (pull_request) Has been cancelled
46 lines
1.1 KiB
YAML
46 lines
1.1 KiB
YAML
name: CI/CD Pipeline for DevStar Extension
|
|
on:
|
|
push:
|
|
branches:
|
|
- main
|
|
pull_request:
|
|
branches:
|
|
- main
|
|
|
|
jobs:
|
|
build:
|
|
runs-on: ubuntu-latest
|
|
container:
|
|
image: node:20-alpine
|
|
steps:
|
|
- name: 拉取代码
|
|
uses: https://devstar.cn/actions/checkout@v4
|
|
with:
|
|
fetch-depth: 0
|
|
|
|
- name: 安装依赖
|
|
run: |
|
|
npm install
|
|
|
|
- name: 安装 Git
|
|
run: |
|
|
apk add --no-cache git
|
|
|
|
- name: 构建插件
|
|
run: |
|
|
npm run package
|
|
|
|
- name: 发布插件
|
|
if: gitea.event_name == 'push' && gitea.ref == 'refs/heads/main'
|
|
run: |
|
|
npm run publish
|
|
env:
|
|
VSCE_PAT: ${{ secrets.VSCE_PAT }}
|
|
|
|
- name: 更新版本标签
|
|
run: |
|
|
version=$(node -p "require('./package.json').version")
|
|
git config --local user.email "ci@devstar.cn"
|
|
git config --local user.name "DevStar CI"
|
|
git tag -a "v$version" -m "Release version $version"
|
|
git push origin "v$version" |