-
Notifications
You must be signed in to change notification settings - Fork 52
135 lines (127 loc) · 4.29 KB
/
publish.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
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
name: Publish
on:
release:
types: [published]
env:
CARGO_INCREMENTAL: 0
CI: 1
RUST_BACKTRACE: short
RUSTFLAGS: "-D warnings"
jobs:
build:
name: Build (${{ matrix.archive }})
runs-on: ${{ matrix.os }}
strategy:
matrix:
include:
- os: windows-latest
target: x86_64-pc-windows-msvc
program: cargo
archive: texlab-x86_64-windows.zip
- os: windows-latest
target: i686-pc-windows-msvc
program: cargo
archive: texlab-i686-windows.zip
- os: windows-latest
target: aarch64-pc-windows-msvc
program: cargo
archive: texlab-aarch64-windows.zip
- os: macos-latest
target: x86_64-apple-darwin
program: cargo
archive: texlab-x86_64-macos.tar.gz
- os: macos-latest
target: aarch64-apple-darwin
program: cargo
archive: texlab-aarch64-macos.tar.gz
- os: ubuntu-20.04
target: x86_64-unknown-linux-gnu
program: cargo
archive: texlab-x86_64-linux.tar.gz
- os: ubuntu-20.04
target: aarch64-unknown-linux-gnu
program: cross
archive: texlab-aarch64-linux.tar.gz
- os: ubuntu-20.04
target: armv7-unknown-linux-gnueabihf
program: cross
archive: texlab-armv7hf-linux.tar.gz
- os: ubuntu-20.04
target: x86_64-unknown-linux-musl
program: cargo
archive: texlab-x86_64-alpine.tar.gz
steps:
- uses: actions/checkout@v3
- uses: dtolnay/rust-toolchain@stable
with:
targets: ${{ matrix.target }}
- name: Install cross
if: ${{ matrix.program == 'cross' }}
run: cargo install cross
- name: Compile
run: ${{ matrix.program }} build --target ${{ matrix.target }} --all-features --release --locked
- name: Compress (Windows)
if: ${{ contains(matrix.os, 'windows') }}
run: ${{ format('Compress-Archive target/{0}/release/texlab.exe {1}', matrix.target, matrix.archive) }}
- name: Compress (macOS)
if: ${{ contains(matrix.os, 'macos') }}
run: ${{ format('gtar -czvf {1} -C target/{0}/release texlab', matrix.target, matrix.archive) }}
- name: Compress (Linux)
if: ${{ contains(matrix.os, 'ubuntu') }}
run: ${{ format('tar -czvf {1} -C target/{0}/release texlab', matrix.target, matrix.archive) }}
- name: Upload binary archive
uses: actions/upload-artifact@v3
with:
name: ${{ matrix.target }}
path: ${{ matrix.archive }}
github:
name: GitHub
needs: [build]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/download-artifact@v3
- name: Publish binaries
run: |
gh release upload ${{ github.ref_name }} $(find . -iname texlab*.zip)
gh release upload ${{ github.ref_name }} $(find . -iname texlab*.tar.gz)
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
ctan:
name: CTAN
needs: [github]
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v3
- uses: dtolnay/rust-toolchain@stable
- name: Install Tectonic workaround
run: |
sudo add-apt-repository universe
sudo apt install libfuse2
- name: Install Tectonic
uses: wtfjoke/setup-tectonic@v2
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
- name: Generate PDF documentation
run: |
mkdir texlab
tectonic texlab.tex -o texlab
- name: Generate man page
run: |
sudo apt install -y help2man
cargo build
help2man --output=texlab/texlab.1 --no-info "target/debug/texlab"
- name: Export to ZIP archive
run: |
git archive --prefix=texlab/ -o texlab.zip HEAD
zip -ur texlab.zip texlab/texlab.1 texlab/texlab.pdf
- uses: paolobrasolin/ctan-submit-action@v1
with:
action: upload
file_path: texlab.zip
fields: |
pkg: texlab
version: ${{ github.event.release.tag_name }}
uploader: Eric Förster
email: [email protected]
update: 'true'