mirror of
https://github.com/ctwj/urldb.git
synced 2025-11-25 03:15:04 +08:00
update: add actions
This commit is contained in:
58
.github/workflows/release.yml
vendored
Normal file
58
.github/workflows/release.yml
vendored
Normal file
@@ -0,0 +1,58 @@
|
||||
name: Release
|
||||
|
||||
on:
|
||||
push:
|
||||
tags:
|
||||
- 'v*'
|
||||
workflow_dispatch:
|
||||
# 可选:添加输入参数,用于测试不同的场景
|
||||
inputs:
|
||||
version-suffix:
|
||||
description: 'Version suffix for testing (e.g., -test, -rc)'
|
||||
required: false
|
||||
default: '-test'
|
||||
|
||||
jobs:
|
||||
build:
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Setup Go
|
||||
uses: actions/setup-go@v4
|
||||
with:
|
||||
go-version: '1.23'
|
||||
|
||||
- name: Build Linux binary
|
||||
run: |
|
||||
chmod +x scripts/build.sh
|
||||
./scripts/build.sh build-linux
|
||||
|
||||
- name: Rename binary
|
||||
run: mv main urldb-${{ github.ref_name }}-linux-amd64
|
||||
|
||||
- name: Setup Node
|
||||
uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version: 20
|
||||
|
||||
- name: Build Frontend
|
||||
run: |
|
||||
cd web
|
||||
npm install --frozen-lockfile
|
||||
npm run build
|
||||
|
||||
- name: Create frontend archive
|
||||
run: |
|
||||
cd web
|
||||
tar -czf ../frontend-${{ github.ref_name }}.tar.gz .output/
|
||||
|
||||
- name: Create Release
|
||||
uses: softprops/action-gh-release@v1
|
||||
with:
|
||||
files: |
|
||||
urldb-${{ github.ref_name }}-linux-amd64
|
||||
frontend-${{ github.ref_name }}.tar.gz
|
||||
generate_release_notes: true
|
||||
@@ -35,7 +35,7 @@
|
||||
|
||||
/* 搜索高亮样式 */
|
||||
mark {
|
||||
@apply bg-yellow-200 text-yellow-900 px-1 py-0.5 rounded font-medium;
|
||||
@apply bg-yellow-200 text-yellow-900 rounded font-medium;
|
||||
}
|
||||
|
||||
/* 暗色模式下的高亮样式 */
|
||||
|
||||
Reference in New Issue
Block a user