-
Notifications
You must be signed in to change notification settings - Fork 161
107 lines (102 loc) · 2.93 KB
/
build.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
98
99
100
101
102
103
104
105
106
name: Build sources
on:
push:
branches:
- main
paths:
- 'src/**'
- '.github/workflows/build.yaml'
concurrency:
group: ${{ github.workflow }}
cancel-in-progress: true
jobs:
build:
env:
RUSTC_WRAPPER: sccache
SCCACHE_CACHE_SIZE: 2G
SCCACHE_VERSION: 0.3.0
runs-on: ubuntu-latest
steps:
-
uses: actions/checkout@v3
-
uses: google/wireit@setup-github-actions-caching/v1
-
name: Cache rust stuff
uses: actions/cache@v3
with:
path: |
~/.cargo/registry/index
~/.cargo/registry/cache
~/.cargo/git/db
~/.cargo/bin
src/rust/**/target/
key: ${{ runner.os }}-cargo3-${{ hashFiles('**/Cargo.lock') }}
restore-keys: |
${{ runner.os }}-cargo3-
-
name: sccache
uses: actions/cache@v3
with:
path: ~/.cache/sccache
key: ${{ runner.os }}-sccache-${{ github.sha }}
restore-keys: ${{ runner.os }}-sccache-
-
uses: actions-rs/toolchain@v1
with:
toolchain: nightly
override: true
target: wasm32-unknown-unknown
-
name: Install build dependencies
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
sudo ln -s $(which wasm-ld-13 || which wasm-ld-12 || which wasm-ld-11 || which wasm-ld-10) /usr/bin/wasm-ld
AIDOKU_CLI_VER=$(gh api repos/Aidoku/aidoku-cli/releases -q '.[0].tag_name')
gh release download -R Aidoku/aidoku-cli "$AIDOKU_CLI_VER" -p *_amd64.deb
sudo dpkg -i "aidoku-cli_${AIDOKU_CLI_VER:1}_linux_amd64.deb"
SCCACHE_FILE=sccache-v$SCCACHE_VERSION-x86_64-unknown-linux-musl
curl -L https://github.com/mozilla/sccache/releases/download/v$SCCACHE_VERSION/$SCCACHE_FILE.tar.gz | tar -xz
sudo mv -f $SCCACHE_FILE/sccache /usr/local/bin/sccache
sudo chmod +x /usr/local/bin/sccache
-
name: Build Rust sources
run: |
for src in ./src/rust/*; do
(
cd "$src"
./build.sh -a
)
done
-
name: Building source list
run: |
aidoku build ./**/*.aix
-
name: Deploy to GitHub Pages
uses: JamesIves/[email protected]
if: ${{ github.ref == 'refs/heads/main' }}
with:
branch: gh-pages
folder: public
git-config-name: GitHub Actions
git-config-email: github-actions[bot]@users.noreply.github.com
commit-message: Update source list
single-commit: true
-
name: Uploading packages as artifact
uses: actions/upload-artifact@v3
if: always()
with:
name: packages
path: public/sources/*.aix
if-no-files-found: ignore
-
name: Uploading gh-pages deployment as artifact
uses: actions/upload-artifact@v3
if: always()
with:
name: gh-pages
path: public
if-no-files-found: ignore