-
Notifications
You must be signed in to change notification settings - Fork 0
77 lines (76 loc) · 2.99 KB
/
update_submodule.yml
File metadata and controls
77 lines (76 loc) · 2.99 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
name: Update Polyblade
on:
repository_dispatch:
types:
- update-submodule
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch: {}
jobs:
update-submodule:
runs-on: ubuntu-latest
permissions:
contents: write
pull-requests: write
steps:
- uses: actions/checkout@v4
with:
token: ${{ secrets.PAT }}
submodules: recursive
- uses: actions/cache@v4
with:
key: ${{ runner.os }}-${{ github.workflow }}-${{ inputs.cache_version }}-rust-${{ github.job }}-${{ hashFiles('**/Cargo.toml', '**/Cargo.lock') }}-${{ github.sha }}
path: |
~/.cache/sccache
~/.cargo/bin/
~/.cargo/registry/cache/
~/.cargo/registry/index/
~/.cargo/git/db/
target/
restore-keys: |
${{ runner.os }}-${{ github.workflow }}-${{ inputs.cache_version }}-rust-${{ github.job }}-${{ hashFiles('**/Cargo.toml', '**/Cargo.lock') }}-
${{ runner.os }}-${{ github.workflow }}-${{ inputs.cache_version }}-rust-${{ github.job }}-
- uses: dtolnay/rust-toolchain@stable
with:
targets: wasm32-unknown-unknown
- name: Authorize Git
run: |
git config --global user.email "$GITHUB_ACTOR@users.noreply.github.com"
git config --global user.name "$GITHUB_ACTOR"
- name: Update submodule
run: |
git submodule update --init --recursive --remote -f
env:
GITHUB_TOKEN: ${{ secrets.PAT }}
# easily install any rust bins without building them
- uses: cargo-bins/cargo-binstall@main
# install cargo-auditable to produce the binary
- run: cargo binstall -y trunk
# install sccache (compilation cache)
- uses: mozilla-actions/sccache-action@v0.0.4
# install mold (linker)
- uses: rui314/setup-mold@v1
- run: ld --version
- name: Trunk Build
run: |
cd polyblade
trunk build --release
cd ..
- name: Create Public Files
run: |
rm -rf public/software/polyblade_live
cp -r polyblade/dist public/software/polyblade_live
sed -i "s/\/polyblade-/\/software\/polyblade_live\/polyblade-/g" public/software/polyblade_live/index.html
- name: Update Article Readme
run: |
rm -rf src/content/software/polyblade/index.mdx public/software/polyblade_assets
cp -r polyblade/assets public/software/polyblade_assets
cat src/content/software/polyblade/index.header polyblade/README.md > src/content/software/polyblade/index.mdx
sed -i "s/.\/assets/.\/software\/polyblade_assets/g" src/content/software/polyblade/index.mdx
- name: Commit changes
run: |
git add polyblade public/software/polyblade_live
git checkout main
git commit -m "Update submodule to latest commit"
git push origin HEAD:main
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}