-
Notifications
You must be signed in to change notification settings - Fork 42
54 lines (46 loc) · 1.64 KB
/
deno.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
name: Build and publish Deno package
on:
push:
tags:
- 'v*'
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v1
- name: Get version
id: version
shell: bash
run: echo ::set-output name=VERSION::"$([[ "$GITHUB_REF" == refs/tags/v* ]] && echo ${GITHUB_REF#refs/tags/v} || echo '0.0.0')"
- name: Set up Rust
uses: actions-rs/toolchain@v1
with:
toolchain: stable
profile: minimal
default: true
- name: Install wasm-pack
working-directory: ./minify-html-wasm
shell: bash
run: curl https://rustwasm.github.io/wasm-pack/installer/init.sh -sSf | sh
- name: Build native module
working-directory: ./minify-html-wasm
shell: bash
run: TARGET=web ./build
- name: Install B2 CLI
run: |
wget -O b2 https://github.com/Backblaze/B2_Command_Line_Tool/releases/latest/download/b2-linux
chmod +x b2
- name: Upload to B2
run: |
./b2 authorize-account ${{ secrets.CICD_CLI_B2_KEY_ID }} ${{ secrets.CICD_CLI_B2_APPLICATION_KEY }}
for f in minify-html-wasm/pkg/*; do
if [[ "$f" == *.js ]]; then
content_type='text/javascript'
elif [[ "$f" == *.wasm ]]; then
content_type='application/wasm'
else
content_type='application/octet-stream'
fi
./b2 upload-file --contentType "$content_type" ${{ secrets.CICD_CLI_B2_BUCKET_NAME }} "$f" "minify-html/deno/${{ steps.version.outputs.VERSION }}/$(basename "$f")"
done