This repository has been archived by the owner on Jul 25, 2023. It is now read-only.
generated from Flysoft-Studio/QQNTim-Plugin-Template
-
Notifications
You must be signed in to change notification settings - Fork 0
64 lines (54 loc) · 1.8 KB
/
build.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
name: Build
on:
workflow_dispatch:
push:
jobs:
build:
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- uses: actions/checkout@v3
- name: Use Node.js
uses: actions/setup-node@v3
with:
node-version: 18.x
- name: Setup Corepack
run: corepack enable
- name: Cache Yarn dependencies
id: yarn-cache
uses: actions/cache@v3
with:
path: |
.yarn/cache
.yarn/unplugged
.yarn/install-state.gz
.pnp.cjs
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-
- name: Install Yarn dependencies
run: yarn
- name: Build
run: yarn build
- name: Compress files
run: |
mkdir upload
pushd dist
zip -r9 ../upload/$(node --eval 'console.log(require("../publish/qqntim.json").id)').zip .
popd
- name: Upload artifact
uses: actions/upload-artifact@v3
with:
name: build
path: upload/*
- name: Create release
if: github.ref_type == 'tag'
uses: softprops/action-gh-release@v1
with:
files: upload/*
generate_release_notes: true
tag_name: ${{ github.ref_name }}
prerelease: ${{ endsWith(github.ref_name, 'alpha') }}
draft: false
name: ${{ github.ref_name }}