-
-
Notifications
You must be signed in to change notification settings - Fork 0
138 lines (121 loc) · 3.79 KB
/
plugin.yml
File metadata and controls
138 lines (121 loc) · 3.79 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
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
136
137
138
name: Xodium CI/CD - Plugin
on:
push:
branches: [ main ]
workflow_dispatch:
permissions:
contents: read
packages: write
concurrency:
group: "${{ github.workflow }}-${{ github.ref }}"
cancel-in-progress: true
jobs:
lint:
name: Lint
runs-on: ubuntu-latest
environment:
name: "${{ github.ref_name }}"
steps:
- id: checkout
name: Checkout
uses: actions/checkout@v6.0.2
- id: setup_rust
name: Setup Rust
uses: actions-rust-lang/setup-rust-toolchain@d197c158264056996cfba74a9c2d93886346edc3
with:
toolchain: stable
target: wasm32-wasip2
components: rustfmt, clippy
- id: run_lint
name: Run Lint
run: |
cargo clippy --all-targets --all-features -- -D warnings
cargo fmt --all -- --check
shell: bash
build:
name: Build
needs: [ lint ]
runs-on: ubuntu-latest
environment:
name: "${{ github.ref_name }}"
url: "${{ steps.upload_artifact.outputs.artifact-url }}"
outputs:
VERSION: "${{ steps.get_version.outputs.VERSION }}"
NAME: "${{ steps.get_name.outputs.NAME }}"
steps:
- id: checkout
name: Checkout
uses: actions/checkout@v6.0.2
- id: cache_dependencies
name: Cache dependencies
uses: actions/cache@v5.0.4
with:
path: |
~/.cargo/registry
~/.cargo/git
target
key: ${{ runner.os }}-wasm32-wasip2-cargo-${{ hashFiles('**/Cargo.lock') }}
- id: setup_rust
name: Setup Rust
uses: actions-rust-lang/setup-rust-toolchain@d197c158264056996cfba74a9c2d93886346edc3
with:
toolchain: stable
target: wasm32-wasip2
- id: build_artifact
name: Build Artefact
run: cargo build --release --target wasm32-wasip2 --timings
shell: bash
- id: get_name
name: Get Name
run: echo "NAME=$(cargo metadata --no-deps --format-version 1 | jq -r '.packages[0].name')" >> $GITHUB_OUTPUT
shell: bash
- id: get_version
name: Get Version
run: |
echo "VERSION=$(cargo pkgid | cut -d# -f2 | cut -d: -f2)" >> $GITHUB_OUTPUT
shell: bash
- id: upload_artifact
name: Upload Artifact
uses: actions/upload-artifact@v7.0.0
with:
name: ${{ steps.get_name.outputs.NAME }}-wasm32-wasip2
path: target/wasm32-wasip2/release/${{ steps.get_name.outputs.NAME }}.wasm
retention-days: 7
nightly_release:
name: Nightly Release
needs: [ build ]
runs-on: ubuntu-latest
environment:
name: "${{ github.ref_name }}"
permissions:
contents: write
steps:
- id: checkout
name: Checkout
uses: actions/checkout@v6.0.2
- id: download_artifacts
name: Download Artefacts
uses: actions/download-artifact@v8.0.1
with:
pattern: "${{ needs.build.outputs.NAME }}-*"
path: dist/
merge-multiple: true
- id: update_nightly_tag
name: Update Nightly Tag
run: |
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"
git tag --force nightly && git push --force origin tag nightly
- id: create_nightly_release
name: Create Nightly Release
uses: softprops/action-gh-release@153bb8e04406b158c6c84fc1615b65b24149a1fe
env:
GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
with:
prerelease: true
files: dist/${{ needs.build.outputs.NAME }}*
tag_name: nightly
name: Nightly Build
body: |
From commit: ${{ github.sha }}
Generated on: ${{ github.event.head_commit.timestamp }}