-
Notifications
You must be signed in to change notification settings - Fork 0
60 lines (51 loc) · 1.8 KB
/
build-release.yaml
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
name: Download and Build Pixiv
on:
workflow_dispatch:
schedule:
# Once a day at midnight
- cron: '0 0 * * *'
jobs:
build-publish:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Get latest Pixiv dump URL
id: get_url
uses: actions/github-script@v5
with:
script: |
const repo = "MarvNC/pixiv-dump"
const releases = await github.rest.repos.listReleases({
owner: repo.split('/')[0],
repo: repo.split('/')[1]
})
const latestRelease = releases.data[0]
const asset = latestRelease.assets.find(asset => asset.name === 'pixiv.db')
if (!asset) {
throw new Error('Asset not found')
}
return asset.browser_download_url
- name: Download latest dump
run: wget -P db "${{ steps.get_url.outputs.result }}"
- name: Install Dependencies
run: npm ci
- name: Get Current Date
id: date
run: echo "::set-output name=date::$(date +'%Y-%m-%d')"
- name: Build Dictionary
run: |
npm run start
npm run buildPixiv -- --tagName ${{ steps.date.outputs.date }}
npm run buildPixivLight -- --tagName ${{ steps.date.outputs.date }}
env:
NODE_OPTIONS: --max-old-space-size=4096
- name: Create and Publish Release
uses: softprops/action-gh-release@v1
with:
files: dist/*
tag_name: ${{ steps.date.outputs.date }}
name: ${{ steps.date.outputs.date }}
token: ${{ secrets.GITHUB_TOKEN }}
body: |
This is an automated release of the latest Pixiv for Yomitan.
Please check the [README](https://github.com/MarvNC/pixiv-yomitan) for more information.