Skip to content

Commit c222ed2

Browse files
committed
feat: add workflow files
1 parent b8ee661 commit c222ed2

File tree

3 files changed

+149
-0
lines changed

3 files changed

+149
-0
lines changed

.github/workflows/release.yml

Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
name: Release
2+
on:
3+
push:
4+
tags:
5+
- "v*"
6+
workflow_dispatch:
7+
8+
jobs:
9+
release:
10+
permissions:
11+
contents: write
12+
strategy:
13+
fail-fast: false
14+
matrix:
15+
platform: [macos-latest, ubuntu-22.04, windows-latest]
16+
runs-on: ${{ matrix.platform }}
17+
18+
steps:
19+
- uses: actions/checkout@v4
20+
21+
- name: setup node
22+
uses: actions/setup-node@v4
23+
with:
24+
node-version: lts/*
25+
26+
- name: install Rust
27+
uses: dtolnay/rust-toolchain@stable
28+
with:
29+
toolchain: nightly-2024-05-04 # 1.80.0-nightly (e82c861d7 2024-05-04)
30+
targets: wasm32-unknown-unknown,${{ matrix.platform == 'macos-latest' && 'aarch64-apple-darwin,x86_64-apple-darwin' || '' }}
31+
32+
- name: install Tauri cli
33+
run: cargo install tauri-cli
34+
35+
- name: install Tailwind CSS
36+
run: npm i -g tailwindcss
37+
38+
- name: generate Tailwind CSS
39+
run: npx tailwindcss -i ./input.css -o ./style/output.css
40+
41+
- uses: jetli/trunk-action@v0.1.0
42+
with:
43+
# Optional version of trunk to install(eg. 'v0.8.1', 'latest')
44+
version: "latest"
45+
46+
- name: install dependencies (ubuntu only)
47+
if: matrix.platform == 'ubuntu-22.04'
48+
run: |
49+
sudo apt-get update
50+
sudo apt-get install -y libgtk-3-dev libwebkit2gtk-4.0-dev libayatana-appindicator3-dev librsvg2-dev
51+
- name: Rust cache
52+
uses: swatinem/rust-cache@v2
53+
with:
54+
workspaces: "./src-tauri -> target"
55+
56+
- name: build in release mode
57+
run: cargo tauri build
58+
59+
- uses: tauri-apps/tauri-action@v0
60+
env:
61+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
62+
with:
63+
tagName: ${{ github.ref_name }} # This only works if your workflow triggers on new tags.
64+
releaseName: "RSQL v__VERSION__" # tauri-action replaces \_\_VERSION\_\_ with the app version.
65+
releaseBody: "See the assets to download and install this version."
66+
releaseDraft: true
67+
prerelease: false

.github/workflows/rust-clippy.yml

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
# This workflow uses actions that are not certified by GitHub.
2+
# They are provided by a third-party and are governed by
3+
# separate terms of service, privacy policy, and support
4+
# documentation.
5+
# rust-clippy is a tool that runs a bunch of lints to catch common
6+
# mistakes in your Rust code and help improve your Rust code.
7+
# More details at https://github.com/rust-lang/rust-clippy
8+
# and https://rust-lang.github.io/rust-clippy/
9+
10+
name: rust-clippy analyze
11+
12+
on:
13+
push:
14+
branches: [ "main" ]
15+
pull_request:
16+
# The branches below must be a subset of the branches above
17+
branches: [ "main" ]
18+
schedule:
19+
- cron: '35 7 * * 1'
20+
21+
jobs:
22+
rust-clippy-analyze:
23+
name: Run rust-clippy analyzing
24+
runs-on: ubuntu-latest
25+
container:
26+
image: rust:latest
27+
permissions:
28+
contents: read
29+
security-events: write
30+
actions: read # only required for a private repository by github/codeql-action/upload-sarif to get the Action run status
31+
steps:
32+
- name: Checkout code
33+
uses: actions/checkout@v2
34+
35+
- name: Install Rust toolchain
36+
uses: actions-rs/toolchain@16499b5e05bf2e26879000db0c1d13f7e13fa3af #@v1
37+
with:
38+
profile: minimal
39+
toolchain: stable
40+
components: clippy
41+
override: true
42+
43+
- name: Install required cargo
44+
run: cargo install clippy-sarif sarif-fmt
45+
46+
- name: Run rust-clippy
47+
run:
48+
cargo clippy
49+
--all-features
50+
--message-format=json | clippy-sarif | tee rust-clippy-results.sarif | sarif-fmt
51+
continue-on-error: true
52+
53+
- name: Upload analysis results to GitHub
54+
uses: github/codeql-action/upload-sarif@v1
55+
with:
56+
sarif_file: rust-clippy-results.sarif
57+
wait-for-processing: true

.github/workflows/rust.yml

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
name: Rust
2+
3+
on:
4+
push:
5+
branches: [ "main" ]
6+
pull_request:
7+
branches: [ "main" ]
8+
9+
env:
10+
CARGO_TERM_COLOR: always
11+
12+
jobs:
13+
build:
14+
15+
runs-on: ubuntu-latest
16+
# add rust nightly
17+
container:
18+
image: rustlang/rust:nightly
19+
20+
steps:
21+
- uses: actions/checkout@v3
22+
- name: Build
23+
run: cargo build --verbose
24+
- name: Run tests
25+
run: cargo test --verbose

0 commit comments

Comments
 (0)