-
Notifications
You must be signed in to change notification settings - Fork 3
55 lines (47 loc) · 1.51 KB
/
validate.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
name: Validate
on: [push, pull_request]
permissions: "read-all"
jobs:
validate:
if: "(!contains(github.event.commits[0].message, '[skip ci]')) && (!contains(github.event.commits[0].message, '[ci skip]'))"
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
with:
persist-credentials: false
- name: Check suimu
id: check-suimu
uses: actions/github-script@v6
with:
script: |
let lastRel = await github.rest.repos.getLatestRelease({
owner: "suisei-cn",
repo: "suimu",
})
let downloadUrl = lastRel.data.assets.filter(x => x.name === "suimu-Linux").map(x => x.browser_download_url)
if (downloadUrl.length === 0) throw Error("No valid suimu-Linux found!")
return downloadUrl[0]
- name: Download suimu
run: |
wget ${{ steps.check-suimu.outputs.result }} -O suimu
chmod +x ./suimu
- name: Check CSV
run: ./suimu check ./suisei-music.csv
deploy:
if: "github.event_name == 'push' && github.ref == 'refs/heads/master'"
needs: validate
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
with:
persist-credentials: false
- name: Invoke remote
env:
BIN_API_KEY: ${{ secrets.BIN_API_KEY }}
GITHUB_SHA: ${{ github.sha }}
run: |
cd tools
npm install got
node deploy.mjs