update ci #17
Workflow file for this run
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: Build | |
on: | |
push: | |
tags: | |
- 'v*' | |
# Allows you to run this workflow manually from the Actions tab | |
workflow_dispatch: | |
jobs: | |
# Build job | |
build: | |
runs-on: windows-latest | |
permissions: write-all | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 # Not needed if lastUpdated is not enabled | |
# - uses: pnpm/action-setup@v3 # Uncomment this block if you're using pnpm | |
# with: | |
# version: 9 # Not needed if you've set "packageManager" in package.json | |
# - uses: oven-sh/setup-bun@v1 # Uncomment this if you're using Bun | |
- name: Setup Node | |
uses: actions/setup-node@v4 | |
with: | |
node-version: 20 | |
cache: npm # or pnpm / yarn | |
- name: Install dependencies | |
run: npm install | |
- name: Build with VitePress | |
run: npm run docs:build | |
- name: Build docan | |
run: npm run docan | |
- name: Build worker | |
run: npm run worker | |
- name: Build api | |
run: npm run api | |
- name: Build APP | |
run: npm run build:win | |
- name: Upload artifact | |
env: | |
ALIYUN_ACCESS_KEY_ID: ${{ secrets.ALIYUN_ACCESS_KEY_ID }} | |
ALIYUN_ACCESS_KEY_SECRET: ${{ secrets.ALIYUN_ACCESS_KEY_SECRET }} | |
run: node tools/upload.js --note --app | |
- name: Create Release | |
id: create_release | |
uses: actions/create-release@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # This token is provided by Actions, you do not need to create your own token | |
with: | |
tag_name: ${{ github.ref }} | |
release_name: Release ${{ github.ref }} | |
draft: false | |
prerelease: false | |
- name: Upload Release Asset | |
id: upload-release-asset | |
uses: actions/upload-release-asset@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
upload_url: ${{ steps.create_release.outputs.upload_url }} # This pulls from the CREATE RELEASE step above, referencing it's ID to get its outputs object, which include a `upload_url`. See this blog post for more info: https://jasonet.co/posts/new-features-of-github-actions/#passing-data-to-future-steps | |
asset_path: ./dist/EcuBus-Pro ${{ github.ref_name }}.exe | |
asset_name: EcuBus-Pro ${{ github.ref_name }}.exe | |
asset_content_type: application/vnd.microsoft.portable-executable |