Skip to content

Commit

Permalink
✅ test: add cicd
Browse files Browse the repository at this point in the history
  • Loading branch information
莫伟杰 committed Aug 30, 2024
1 parent 5d24561 commit 334377a
Show file tree
Hide file tree
Showing 5 changed files with 1,647 additions and 1,114 deletions.
82 changes: 82 additions & 0 deletions .github/workflows/vsx-release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
name: VSX Release

permissions:
contents: write

on:
push:
branches:
- "publish"
# tags:
# - "v*" # Push events to matching v*, i.e. v1.0, v20.15.10
# - "vscode/**"

jobs:
deploy:
runs-on: ubuntu-latest

steps:
- name: Check out git repository
uses: actions/checkout@v4.1.1

# - uses: pnpm/action-setup@v3
- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: 16
# support pnpm yarn npm or ''
cache: yarn
registry-url: "https://registry.npmmirror.com"

- id: ShortSha
run: echo "::set-output name=value::$(git rev-parse --short HEAD)"

# - name: Install dependencies
# run: pnpm install
- name: Install dependencies
run: yarn
# 使用@/vscode/vsce 会预先执行vscode:prepublish
# https://github.com/HaaLeo/publish-vscode-extension
- name: Build and publish vscode vsx
uses: HaaLeo/publish-vscode-extension@v1
id: PublishVSX
with:
# 如果项目不在根目录, 可以修改这里
# packagePath: ./packages/vscode
pat: ${{ secrets.VSCODE_TOKEN }}

skipDuplicate: false
registryUrl: https://marketplace.visualstudio.com
yarn: false

- name: Zip Dist
run: zip -r archive.zip . -x "./node_modules/*" "./out/*" "./.git/*"

- name: Read package.json
uses: tyankatsu0105/read-package-version-actions@v1
with:
path: "./"
id: PackageVersion

- name: Create Release for Tag
id: CreateRelease
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.PERSONAL_TOKEN }} # 这块需要用到 github的token,因为需要对分之进行代码推送
with:
tag_name: build-v${{ steps.PackageVersion.outputs.version }}
release_name: Release v${{ steps.PackageVersion.outputs.version }}
prerelease: false # 是否为预发布版本
draft: false
body: |
新版本发布v${{ steps.PackageVersion.outputs.version }}
- name: Upload Release Asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.PERSONAL_TOKEN }}
with:
upload_url: ${{ steps.CreateRelease.outputs.upload_url }}
asset_path: ./archive.zip
asset_name: bundled.zip
asset_content_type: application/zip
2 changes: 2 additions & 0 deletions .npmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
enable-pre-post-scripts=true
registry=https://registry.npmmirror.com/
3 changes: 2 additions & 1 deletion .yarnrc
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
--ignore-engines true
--ignore-engines true
registry https://registry.npmmirror.com/
50 changes: 25 additions & 25 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
"url": "https://github.com/weekitmo/flutter-assets-gen.git"
},
"publisher": "weekit",
"version": "0.1.7",
"version": "0.1.8",
"engines": {
"vscode": "^1.59.0"
},
Expand Down Expand Up @@ -81,33 +81,33 @@
]
},
"devDependencies": {
"@commitlint/cli": "^13.1.0",
"@commitlint/core": "^13.1.0",
"@types/glob": "^7.1.3",
"@types/js-yaml": "^4.0.2",
"@types/lodash": "^4.14.172",
"@types/mocha": "^8.2.2",
"@types/node": "14.x",
"@types/vscode": "^1.59.0",
"@typescript-eslint/eslint-plugin": "^4.26.0",
"@typescript-eslint/parser": "^4.26.0",
"auto-changelog": "^2.3.0",
"commitizen": "^4.2.4",
"commitlint-config-cz": "^0.13.2",
"commitlint-config-gitmoji": "^2.2.5",
"cz-customizable": "^6.3.0",
"eslint": "^7.27.0",
"eslint-config-prettier": "^8.3.0",
"eslint-plugin-prettier": "^3.4.0",
"@commitlint/cli": "13.1.0",
"@commitlint/core": "13.1.0",
"@types/glob": "7.1.3",
"@types/js-yaml": "4.0.2",
"@types/lodash": "4.14.172",
"@types/mocha": "8.2.2",
"@types/node": "14.14.31",
"@types/vscode": "1.59.0",
"@typescript-eslint/eslint-plugin": "4.26.0",
"@typescript-eslint/parser": "4.26.0",
"auto-changelog": "2.3.0",
"commitizen": "4.2.4",
"commitlint-config-cz": "0.13.2",
"commitlint-config-gitmoji": "2.2.5",
"cz-customizable": "6.3.0",
"eslint": "7.27.0",
"eslint-config-prettier": "8.3.0",
"eslint-plugin-prettier": "3.4.0",
"husky": "4.3.7",
"lint-staged": "10.5.2",
"prettier": "^2.3.2",
"typescript": "^4.3.2"
"prettier": "2.3.2",
"typescript": "4.3.2"
},
"dependencies": {
"chokidar": "^3.5.2",
"glob": "^7.1.7",
"js-yaml": "^4.1.0",
"lodash": "^4.17.21"
"chokidar": "3.5.2",
"glob": "7.1.7",
"js-yaml": "4.1.0",
"lodash": "4.17.21"
}
}
Loading

0 comments on commit 334377a

Please sign in to comment.