✨ feat: ssl #5
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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: 20 | |
# 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 config set strict-ssl false && 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/*" | |
- 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 |