-
-
Notifications
You must be signed in to change notification settings - Fork 118
46 lines (40 loc) · 1.25 KB
/
ci.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
name: Build Book
on:
push:
branches:
- master
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: ruby/setup-ruby@v1
with:
ruby-version: 2.7
- run: bundle install
- run: rake build:CI
- uses: actions/github-script@v2
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
script: |
const fs = require('fs').promises;
const { repo: { owner, repo }, sha } = context;
const release = await github.repos.createRelease({
owner, repo,
tag_name: `v6.${process.env.GITHUB_RUN_NUMBER}`,
draft: false,
target_commitish: sha
});
console.log('A release has been created');
const build_dir = 'build';
for (let file of await fs.readdir(build_dir)) {
if (file == '.gitkeep') continue;
console.log('uploading', file);
await github.repos.uploadReleaseAsset({
owner, repo,
release_id: release.data.id,
name: file,
data: await fs.readFile(`${build_dir}/${file}`)
});
}
console.log('DONE')