-
Notifications
You must be signed in to change notification settings - Fork 6
62 lines (56 loc) · 1.78 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
name: Build and deploy Tataru Assistant
on:
workflow_dispatch:
schedule:
- cron: '0 */2 * * *'
push:
branches:
- main
jobs:
build-and-deploy:
runs-on: windows-latest
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Execute version check script
id: auto-check
run: bash .github/workflows/autocheck.sh
- name: Build and package
if: steps.auto-check.outputs.status == 'ready'
run: |
npm install
npm run dist
npx electron-builder --win --x64
- name: Create release
id: create_release
if: steps.auto-check.outputs.status == 'ready'
uses: comnoco/create-release-action@v2
env:
RELEASE_VERSION: ${{ steps.auto-check.outputs.release_tag }}
with:
tag_name: v${{ env.RELEASE_VERSION }}
release_name: Release v${{ env.RELEASE_VERSION }}
- name: Upload artifact
if: steps.auto-check.outputs.status == 'ready'
uses: actions/upload-release-asset@v1
env:
RELEASE_VERSION: ${{ steps.auto-check.outputs.release_tag }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: build/Tataru Assistant Setup ${{ steps.auto-check.outputs.release_tag }}.exe
asset_name: Tataru_Assistant_Setup.exe
asset_content_type: application/octet-stream
del_runs:
runs-on: ubuntu-latest
permissions:
actions: write
steps:
- name: Delete workflow runs
uses: Mattraks/delete-workflow-runs@v2
with:
token: ${{ github.token }}
repository: ${{ github.repository }}
retain_days: 0
keep_minimum_runs: 6