-
Notifications
You must be signed in to change notification settings - Fork 2
97 lines (88 loc) · 3.09 KB
/
github-pages.yaml
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
# This is a basic workflow to help you get started with Actions
name: Github Pages
# Controls when the workflow will run
on:
# Triggers the workflow on push or pull request events but only for the "master" branch
push:
branches: [ "master" ]
paths-ignore:
- '.github/workflows/CI.yml'
- '.github/workflows/docker.yml'
- 'doc/**'
- Dockerfile
- docker-compose.yml
- README.md
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
env:
CARGO_TERM_COLOR: always
# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
permissions:
contents: read
pages: write
id-token: write
# Allow one concurrent deployment
concurrency:
group: "pages"
cancel-in-progress: false
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
deploy:
# The type of runner that the job will run on
runs-on: ubuntu-latest
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- name: Check out
uses: actions/checkout@v4
with:
fetch-depth: 0
submodules: true
- name: Setup latest rust compiler (Nightly)
run: |
curl https://sh.rustup.rs -sSf | sh -s -- --default-toolchain nightly -y
- name: Get cache key
id: cache_key
run: |
cd scripts
python3 get_cache_key.py exiv2 libzip x264 ffmpeg || exit 1
- name: Cache
id: cache
uses: actions/cache@v4
with:
path: clib/
key: ${{ runner.os }}-${{ steps.cache_key.outputs.cache_key }}
- name: Setup NASM
if: steps.cache.outputs.cache-hit != 'true'
uses: ilammy/setup-nasm@v1
- name: Build thirdparty library
if: steps.cache.outputs.cache-hit != 'true'
run: |
export PKG_CONFIG_PATH=`pwd`/clib/lib/pkgconfig
cp scripts/build_*.sh -v ./ || exit 1
./build_exiv2.sh || exit 1
./build_libzip.sh || exit 1
./build_x264.sh || exit 1
./build_ffmpeg.sh || exit 1
- name: Document
run: |
export PKG_CONFIG_PATH=`pwd`/clib/lib/pkgconfig
export CMAKE_PREFIX_PATH=`pwd`/clib
export "LIBRARY_PATH=$LIBRARY_PATH:`pwd`/clib/lib"
export "LD_LIBRARY_PATH=$LD_LIBRARY_PATH:`pwd`/clib/lib"
cargo doc --features all -vv || exit 1
- name: Add index files
run: |
echo '<!DOCTYPE HTML><html><head><script>window.location.href="pixiv_downloader/"</script></head><body><a href="pixiv_downloader/">Content Moved</a></body></html>' > target/doc/index.html
- name: Setup Pages
uses: actions/configure-pages@v5
- name: Upload documents
uses: actions/upload-pages-artifact@v3
with:
path: target/doc
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4