mirror of
https://github.com/yaklang/yaklang-chrome-extension.git
synced 2026-09-26 21:21:53 +08:00
Compare commits
28
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
bbcbdd1d81 | ||
|
|
cb05ab70e3 | ||
|
|
207e8172f1 | ||
|
|
6358fc720d | ||
|
|
26c3bbc570 | ||
|
|
5fbd51a073 | ||
|
|
7c1cdd562c | ||
|
|
a4840c9c5e | ||
|
|
e150379c7f | ||
|
|
0c8f82b441 | ||
|
|
fb0a20b065 | ||
|
|
c950ede429 | ||
|
|
50704b68ac | ||
|
|
52a8d315d1 | ||
|
|
ddf036da66 | ||
|
|
ea338fe547 | ||
|
|
ab4f587eda | ||
|
|
289dcdf030 | ||
|
|
ac36e0bfc7 | ||
|
|
8cdd5605bc | ||
|
|
f6cf369b3a | ||
|
|
8e154aae29 | ||
|
|
523889014f | ||
|
|
42b0e958ba | ||
|
|
8d61a5f5e8 | ||
|
|
0fddcc959c | ||
|
|
7af4124da8 | ||
|
|
06fff8f92e |
@@ -0,0 +1,69 @@
|
|||||||
|
name: Build and Release
|
||||||
|
|
||||||
|
on:
|
||||||
|
# 只保留手动触发工作流
|
||||||
|
workflow_dispatch:
|
||||||
|
inputs:
|
||||||
|
branch:
|
||||||
|
description: '选择要构建的分支'
|
||||||
|
required: true
|
||||||
|
default: 'main'
|
||||||
|
type: string
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
build-and-release:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- name: Checkout code
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
with:
|
||||||
|
ref: ${{ github.event.inputs.branch }}
|
||||||
|
|
||||||
|
- name: Setup Node.js
|
||||||
|
uses: actions/setup-node@v4
|
||||||
|
with:
|
||||||
|
node-version: '18'
|
||||||
|
cache: 'yarn' # 改为 yarn 缓存
|
||||||
|
|
||||||
|
- name: Install dependencies
|
||||||
|
run: yarn install --frozen-lockfile
|
||||||
|
|
||||||
|
- name: Build project
|
||||||
|
run: yarn build
|
||||||
|
|
||||||
|
- name: Zip build artifacts
|
||||||
|
run: |
|
||||||
|
cd dist
|
||||||
|
zip -r ../extension.zip .
|
||||||
|
|
||||||
|
- name: Generate version number
|
||||||
|
id: version
|
||||||
|
run: |
|
||||||
|
echo "version=1.0.${{ github.run_number }}" >> $GITHUB_OUTPUT
|
||||||
|
echo "build_time=$(date +'%Y-%m-%d %H:%M:%S')" >> $GITHUB_OUTPUT
|
||||||
|
|
||||||
|
- name: Create Release
|
||||||
|
id: create_release
|
||||||
|
uses: actions/create-release@v1
|
||||||
|
env:
|
||||||
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
with:
|
||||||
|
tag_name: v${{ steps.version.outputs.version }}
|
||||||
|
release_name: Release v${{ steps.version.outputs.version }}
|
||||||
|
body: |
|
||||||
|
Branch: ${{ github.event.inputs.branch }}
|
||||||
|
Commit: ${{ github.sha }}
|
||||||
|
Build Time: ${{ steps.version.outputs.build_time }}
|
||||||
|
draft: false
|
||||||
|
prerelease: false
|
||||||
|
|
||||||
|
- name: Upload Release Asset
|
||||||
|
uses: actions/upload-release-asset@v1
|
||||||
|
env:
|
||||||
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
with:
|
||||||
|
upload_url: ${{ steps.create_release.outputs.upload_url }}
|
||||||
|
asset_path: ./extension.zip
|
||||||
|
asset_name: yakit-chrome-extension-v${{ steps.version.outputs.version }}.zip
|
||||||
|
asset_content_type: application/zip
|
||||||
Reference in New Issue
Block a user