Skip to content

Commit 8e21d93

Browse files
committed
CI
1 parent 3247c95 commit 8e21d93

File tree

3 files changed

+91
-2
lines changed

3 files changed

+91
-2
lines changed

.github/workflows/ci.yaml

Lines changed: 85 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,85 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
tags:
6+
- "v*.*.*"
7+
branches:
8+
- main
9+
pull_request:
10+
11+
env:
12+
CARGO_TERM_COLOR: always
13+
14+
jobs:
15+
build:
16+
runs-on: ubuntu-latest
17+
steps:
18+
- uses: actions/checkout@v4
19+
- uses: Swatinem/rust-cache@v2
20+
with:
21+
prefix-key: v1-rust
22+
shared-key: debug
23+
cache-all-crates: true
24+
- name: Setup Rust
25+
uses: actions-rs/toolchain@v1
26+
with:
27+
toolchain: stable
28+
override: true
29+
- name: Check formatting
30+
run: cargo fmt -- --check
31+
- name: Clippy
32+
run: cargo clippy -- -Dwarnings
33+
- name: Build
34+
run: cargo build --all-features --all-targets
35+
test:
36+
needs: [build]
37+
runs-on: ubuntu-latest
38+
steps:
39+
- uses: actions/checkout@v3
40+
- uses: Swatinem/rust-cache@v2
41+
with:
42+
prefix-key: v1-rust
43+
shared-key: debug
44+
cache-all-crates: false
45+
- name: Setup Rust
46+
uses: actions-rs/toolchain@v1
47+
with:
48+
toolchain: stable
49+
override: true
50+
- name: Tests
51+
run: cargo test -- --nocapture --report-time --format junit --logfile target/report.xml
52+
- name: Publish Test Report
53+
uses: mikepenz/action-junit-report@v5
54+
if: success() || failure() # always run even if the previous step fails
55+
with:
56+
report_paths: "**/target/report-*.xml"
57+
detailed_summary: true
58+
include_passed: true
59+
publish:
60+
needs: [test]
61+
if: "startsWith(github.ref, 'refs/tags/v')"
62+
runs-on: ubuntu-latest
63+
steps:
64+
- name: Checkout
65+
uses: actions/checkout@v3
66+
with:
67+
submodules: true
68+
- name: Setup Rust
69+
uses: actions-rs/toolchain@v1
70+
with:
71+
toolchain: stable
72+
override: true
73+
- name: Install Protoc
74+
uses: arduino/setup-protoc@v3
75+
with:
76+
repo-token: ${{ secrets.GITHUB_TOKEN }}
77+
- id: get_version
78+
uses: battila7/get-version-action@v2
79+
- name: Publish crates
80+
env:
81+
CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }}
82+
run: |
83+
export VERSION="${{ steps.get_version.outputs.version-without-v }}"
84+
sed -i "s/0.0.0/$VERSION/g" Cargo.toml
85+
cargo publish -p moonbit-component-generator --all-features --allow-dirty

Cargo.lock

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,11 @@
11
[package]
22
name = "moonbit-component-generator"
3-
version = "0.1.0"
3+
version = "0.0.0"
44
edition = "2024"
5+
license = "Apache-2.0"
6+
homepage = "https://github.com/golemcloud/moonbit-component-generator"
7+
repository = "https://github.com/golemcloud/moonbit-component-generator"
8+
description = "Library wrapping the MoonBit compiler and other WASM Component Model libraries for generating and compiling WASM components"
59

610
[workspace]
711

0 commit comments

Comments
 (0)