Skip to content

Commit

Permalink
chore: 升级自动构建文件,更新程序版本
Browse files Browse the repository at this point in the history
  • Loading branch information
orangelckc committed Jan 25, 2023
1 parent 9133cc0 commit 72a9b4b
Show file tree
Hide file tree
Showing 5 changed files with 49 additions and 82 deletions.
32 changes: 0 additions & 32 deletions .github/workflows/changelog.yml

This file was deleted.

93 changes: 46 additions & 47 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,92 +1,91 @@
# 可选,将显示在 GitHub 存储库的“操作”选项卡中的工作流名称
name: Release CI

permissions:
contents: write

# 指定此工作流的触发器
on:
push:
# 匹配特定标签 (refs/tags)
tags:
- "v*" # 推送事件匹配 v*, 例如 v1.0,v20.15.10 等来触发工作流
workflow_dispatch:

# 需要运行的作业组合
jobs:
# 任务:创建 release 版本
create-release:
runs-on: ubuntu-latest
outputs:
APP_VERSION: ${{ steps.get_version.outputs.VERSION }}

steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0

# 查询版本号(tag)
- name: Query version number
id: get_version
shell: bash
run: |
echo "using version tag ${GITHUB_REF:10}"
echo ::set-output name=version::"${GITHUB_REF:10}"
# 安装 Node.js
- name: Setup node
uses: actions/setup-node@v3
with:
node-version: 16.x

# 发布 Release,使用自定义名称
- name: Generate changelog
id: create_release
run: npx changelogithub --draft --name 哔哩哔哩-直播间管家机器人${{ steps.get_version.outputs.VERSION }}
env:
GITHUB_TOKEN: ${{ secrets.RELEASE_TOKEN }}


# 编译 Tauri
build-tauri:
build-app:
needs: create-release
strategy:
fail-fast: false
matrix:
platform: [macos-latest, ubuntu-latest, windows-latest]
platform: [macos-latest, ubuntu-20.04, windows-latest]

runs-on: ${{ matrix.platform }}

steps:
- uses: actions/checkout@v3
- name: setup node
uses: actions/setup-node@v1
- name: Checkout repository
uses: actions/checkout@v3
- uses: pnpm/action-setup@v2
with:
node-version: 16

# 安装 Rust
- name: Install Rust stable
uses: actions-rs/toolchain@v1
with:
toolchain: stable

# 使用 Rust 缓存,加快安装速度
- uses: Swatinem/rust-cache@v1
version: 6.32.9

- name: install dependencies (ubuntu only)
if: matrix.platform == 'ubuntu-latest'
if: matrix.platform == 'ubuntu-20.04'
run: |
sudo apt-get update
sudo apt-get install -y libgtk-3-dev webkit2gtk-4.0 libappindicator3-dev librsvg2-dev patchelf
sudo apt-get install -y libgtk-3-dev libwebkit2gtk-4.0-dev libayatana-appindicator3-dev librsvg2-dev
# 获取 yarn 缓存路径
- name: Get yarn cache directory path
id: yarn-cache-dir-path
run: echo "::set-output name=dir::$(yarn config get cacheFolder)"
# 安装 Rust
- name: Install Rust stable
uses: dtolnay/rust-toolchain@stable

# 使用 Rust 缓存,加快安装速度
- name: Rust cache
uses: swatinem/rust-cache@v2
with:
workspaces: './src-tauri -> target'

# 使用 yarn 缓存
- name: Yarn cache
uses: actions/cache@v2
id: yarn-cache # use this to check for `cache-hit` (`steps.yarn-cache.outputs.cache-hit != 'true'`)
# 获取 pnpm 缓存
- name: Sync node version and setup cache
uses: actions/setup-node@v3
with:
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-
node-version: '14'
cache: 'pnpm'

# 安装依赖
- name: Install app dependencies and build it
run: yarn
# 安装依赖, 前端打包
- name: Install app dependencies and build web
run: pnpm install --frozen-lockfile

# 执行构建,以及推送 github release
- uses: tauri-apps/tauri-action@v0
- name: Build the app
uses: tauri-apps/tauri-action@v0
env:
GITHUB_TOKEN: ${{ secrets.RELEASE_TOKEN }}
with:
tagName: ${{ needs.create-release.outputs.APP_VERSION }}
releaseName: 哔哩哔哩-直播机器人 ${{ needs.create-release.outputs.APP_VERSION }}
tagName: ${{ github.ref_name }}
releaseName: 哔哩哔哩-直播间管家机器人 ${{ needs.create-release.outputs.APP_VERSION }}
releaseBody: ""
releaseDraft: true
prerelease: false
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "bili-bot",
"private": true,
"version": "1.0.0",
"version": "1.2.0",
"type": "module",
"scripts": {
"dev": "npm run build:icon & vite",
Expand Down
2 changes: 1 addition & 1 deletion src-tauri/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion src-tauri/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "bili-bot"
version = "1.0.0"
version = "1.2.0"
description = "哔哩哔哩直播间弹幕机器人"
authors = ["半糖人类"]
license = "MIT"
Expand Down

0 comments on commit 72a9b4b

Please sign in to comment.