-
Notifications
You must be signed in to change notification settings - Fork 0
161 lines (130 loc) · 4.42 KB
/
release.yml
File metadata and controls
161 lines (130 loc) · 4.42 KB
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
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
name: Release
on:
push:
tags:
- 'v*'
permissions:
contents: write
jobs:
build:
name: Build (${{ matrix.os }}, ${{ matrix.target }})
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
include:
- os: ubuntu-latest
target: x86_64-unknown-linux-gnu
artifact_name: docstruct
asset_name: docstruct-linux-x86_64
archive_ext: tar.gz
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Install Rust
uses: dtolnay/rust-toolchain@stable
with:
targets: ${{ matrix.target }}
- name: Build release binary
run: cargo build --release --target ${{ matrix.target }}
- name: Strip binary
run: strip target/${{ matrix.target }}/release/${{ matrix.artifact_name }}
- name: Create tarball
run: |
cd target/${{ matrix.target }}/release
tar czf ${{ matrix.asset_name }}.tar.gz ${{ matrix.artifact_name }}
mv ${{ matrix.asset_name }}.tar.gz "$GITHUB_WORKSPACE/"
- name: Upload build artifact
uses: actions/upload-artifact@v4
with:
name: ${{ matrix.asset_name }}
path: ${{ matrix.asset_name }}.${{ matrix.archive_ext }}
if-no-files-found: error
build-rpm:
name: Build RPM (x86_64)
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Install Rust
uses: dtolnay/rust-toolchain@stable
- name: Install RPM build tools
run: |
sudo apt-get update
sudo apt-get install -y rpm
- name: Install cargo-generate-rpm
run: cargo install cargo-generate-rpm
- name: Build release binary
run: cargo build --release
- name: Build RPM
run: cargo generate-rpm
- name: Upload RPM artifact
uses: actions/upload-artifact@v4
with:
name: docstruct-rpm-x86_64
path: target/generate-rpm/*.rpm
if-no-files-found: error
publish:
name: Publish Release
runs-on: ubuntu-latest
needs: [build, build-rpm]
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Download all artifacts
uses: actions/download-artifact@v4
with:
pattern: docstruct-*
path: release-assets
merge-multiple: true
- name: Verify downloaded assets
run: |
ls -lah release-assets
test -n "$(ls -1 release-assets/*.tar.gz 2>/dev/null)"
test -n "$(ls -1 release-assets/*.rpm 2>/dev/null)"
- name: Upload binaries to release
run: |
gh release view "${GITHUB_REF_NAME}" >/dev/null 2>&1 || \
gh release create "${GITHUB_REF_NAME}" --title "${GITHUB_REF_NAME}" --notes ""
gh release upload "${GITHUB_REF_NAME}" \
release-assets/*.tar.gz \
release-assets/*.rpm \
--clobber
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Update release notes
run: |
cat > RELEASE_NOTES.md <<'NOTES'
## Installation
This workflow publishes Linux CLI artifacts:
- **Linux x86_64**: `docstruct-linux-x86_64.tar.gz`
- **RPM package (x86_64)**: `docstruct-*.x86_64.rpm`
Desktop GUI installers (Windows/macOS/Linux GUI packages) are published by the separate GUI workflow.
Extract and run:
```bash
tar xzf docstruct-*.tar.gz
./docstruct --help
```
RPM:
```bash
sudo rpm -ivh docstruct-*.x86_64.rpm
docstruct --help
```
## Dependencies
Runtime dependencies:
- `tesseract` (with language packs: eng, kor, etc.)
- `poppler-utils` (pdfinfo, pdftotext, pdftoppm)
- `soffice` (LibreOffice, required for `.ppt` conversion)
- Python 3.8+ with packages from `requirements.txt`
## Usage
```bash
./docstruct convert input.pdf -o output_dir
./docstruct convert input.docx -o output_dir
./docstruct convert input.pptx -o output_dir
./docstruct convert input.ppt -o output_dir
./docstruct info input.pptx
```
NOTES
gh release edit "${GITHUB_REF_NAME}" --notes-file RELEASE_NOTES.md
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}