forked from GITenberg/Ulysses_4300
-
Notifications
You must be signed in to change notification settings - Fork 0
94 lines (89 loc) · 2.88 KB
/
weekly-release.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
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
on:
workflow_dispatch:
inputs:
tag:
description: 'Tag for new release'
required: true
default: 'v2020.01.01-alpha'
draft:
description: 'Draft release? (true/false)'
required: true
default: 'true'
schedule:
- cron: '10 2 * * 0'
name: Weekly rebuild
jobs:
generate:
name: generate annotated epub
runs-on: ubuntu-latest
steps:
- name: Checkout the repository
uses: actions/checkout@master
- name: install-deps
run: |
sudo apt-get update
sudo apt-get remove python
sudo apt-get install python3 tidy calibre python3-pip
sudo -H pip3 install setuptools
sudo -H pip3 install ebookmaker pytidylib
- name: get ideacrawler
run: |
go install github.com/shsms/[email protected]
- name: get mime
run: |
curl -OL https://github.com/shsms/mime/releases/latest/download/mime-linux-amd64.tar.gz
tar -xvf mime-linux-amd64.tar.gz
chmod +x mime
- name: download annotations
run: |
~/go/bin/ideacrawler &>/dev/null &
sleep 1
make -C scripts download
killall ideacrawler
timeout-minutes: 30
- name: add annotations
run: |
MIME=../mime make -C scripts addanno
mkdir -p reader/badges
cp scripts/badge-*json reader/badges/
- name: generate epub
run: |
export PATH=$PATH:${PWD}
make -C scripts epub
cp ulysses-annotated.epub reader/
- name: env vars
run: |
if [[ "${{ github.event.inputs.tag }}" != "" ]]; then
echo "TAG_STR=${{ github.event.inputs.tag }}" >> $GITHUB_ENV
else
echo "TAG_STR=v$(date +%Y.%m.%d)" >> $GITHUB_ENV
fi
if [[ "${{ github.event.inputs.draft }}" != "" ]]; then
echo "DRAFT_STR=${{ github.event.inputs.draft }}" >> $GITHUB_ENV
else
echo "DRAFT_STR=false" >> $GITHUB_ENV
fi
- name: Create Release
id: createrelease
uses: actions/create-release@latest
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ env.TAG_STR }}
release_name: ${{ env.TAG_STR }}
draft: ${{ env.DRAFT_STR }}
prerelease: false
- name: Upload the artifacts
uses: skx/github-action-publish-binaries@master
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
releaseId: ${{ steps.createrelease.outputs.id }}
args: 'ulysses-annotated*.epub'
- name: Deploy web reader
uses: JamesIves/[email protected]
with:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
BRANCH: gh-pages
FOLDER: reader
CLEAN: true