-
Notifications
You must be signed in to change notification settings - Fork 5
82 lines (68 loc) · 2.19 KB
/
book-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
name: Build and Release
on:
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Clone wiki repo
run: git clone https://github.com/AbhiTheModder/understand-smali.wiki.git
- name: Install Rust
uses: actions-rs/toolchain@v1
with:
toolchain: stable
override: true
- name: Install xelatex
run: sudo apt-get install -y texlive-xetex
- name: Install Crowbook
run: cargo install --git https://github.com/crowdagger/crowbook.git
- name: Build PDF and EPUB
run: |
cd understand-smali.wiki
sed -i 's/```smali/```java/g' *.md
crowbook understand-smali.book
- name: Upload artifacts
uses: actions/upload-artifact@v4
with:
name: understand-smali
path: |
understand-smali.wiki/understand-smali.pdf
understand-smali.wiki/understand-smali.epub
release:
needs: build
runs-on: ubuntu-latest
steps:
- name: Download artifacts
uses: actions/download-artifact@v4
with:
name: understand-smali
- name: Create Release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: v2.2
release_name: Release v2.2
draft: false
prerelease: false
- name: Upload PDF to release
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./understand-smali.pdf
asset_name: understand-smali.pdf
asset_content_type: application/pdf
- name: Upload EPUB to release
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./understand-smali.epub
asset_name: understand-smali.epub
asset_content_type: application/epub+zip