LLOneBot/.github/workflows/publish.yml
2024-09-02 18:28:21 +08:00

44 lines
962 B
YAML

name: Publish
on:
push:
tags:
- 'v*'
jobs:
build-and-publish:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup node
uses: actions/setup-node@v4
with:
node-version: 20
- name: Install dependenies
run: |
export ELECTRON_SKIP_BINARY_DOWNLOAD=1
npm install
- name: Build
run: npm run build
- name: Compress
run: |
sudo apt install zip -y
cd ./dist/
zip -r ../LLOneBot.zip ./*
- name: Extract version from tag
id: get-version
run: echo "VERSION=${GITHUB_REF#refs/tags/v}" >> "$GITHUB_OUTPUT"
- name: Release
uses: ncipollo/release-action@v1
with:
artifacts: 'LLOneBot.zip'
draft: true
token: ${{ secrets.RELEASE_TOKEN }}
name: LLOneBot v${{ steps.get-version.outputs.VERSION }}