Skip to content

Commit fbd5dde

Browse files
committed
feat: add CI for auto publish
1 parent 3c7aabe commit fbd5dde

File tree

6 files changed

+407
-17
lines changed

6 files changed

+407
-17
lines changed

.github/workflows/autofix.yml

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
# -------------------------------------------------------------------
2+
# ------------------------------- WARNING ---------------------------
3+
# -------------------------------------------------------------------
4+
#
5+
# This file was automatically generated by gh-workflows using the
6+
# gh-workflow-gen bin. You should add and commit this file to your
7+
# git repository. **DO NOT EDIT THIS FILE BY HAND!** Any manual changes
8+
# will be lost if the file is regenerated.
9+
#
10+
# To make modifications, update your `build.rs` configuration to adjust
11+
# the workflow description as needed, then regenerate this file to apply
12+
# those changes.
13+
#
14+
# -------------------------------------------------------------------
15+
# ----------------------------- END WARNING -------------------------
16+
# -------------------------------------------------------------------
17+
18+
name: autofix.ci
19+
env:
20+
RUSTFLAGS: -Dwarnings
21+
on:
22+
pull_request:
23+
types:
24+
- opened
25+
- synchronize
26+
- reopened
27+
branches:
28+
- main
29+
push:
30+
branches:
31+
- main
32+
jobs:
33+
lint:
34+
name: Lint Fix
35+
runs-on: ubuntu-latest
36+
permissions:
37+
contents: read
38+
steps:
39+
- name: Checkout Code
40+
uses: actions/checkout@v4
41+
- name: Setup Rust Toolchain
42+
uses: actions-rust-lang/setup-rust-toolchain@v1
43+
with:
44+
toolchain: nightly
45+
components: clippy, rustfmt
46+
- name: Cargo Fmt
47+
run: cargo +nightly fmt --all
48+
- name: Cargo Clippy
49+
run: cargo +nightly clippy --fix --allow-dirty --all-features --workspace -- -D warnings
50+
- uses: autofix-ci/action@ff86a557419858bb967097bfc916833f5647fa8c
51+
concurrency:
52+
group: autofix-${{github.ref}}
53+
cancel-in-progress: false

.github/workflows/ci.yml

Lines changed: 111 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,111 @@
1+
# -------------------------------------------------------------------
2+
# ------------------------------- WARNING ---------------------------
3+
# -------------------------------------------------------------------
4+
#
5+
# This file was automatically generated by gh-workflows using the
6+
# gh-workflow-gen bin. You should add and commit this file to your
7+
# git repository. **DO NOT EDIT THIS FILE BY HAND!** Any manual changes
8+
# will be lost if the file is regenerated.
9+
#
10+
# To make modifications, update your `build.rs` configuration to adjust
11+
# the workflow description as needed, then regenerate this file to apply
12+
# those changes.
13+
#
14+
# -------------------------------------------------------------------
15+
# ----------------------------- END WARNING -------------------------
16+
# -------------------------------------------------------------------
17+
18+
name: ci
19+
env:
20+
RUSTFLAGS: -Dwarnings
21+
on:
22+
pull_request:
23+
types:
24+
- opened
25+
- synchronize
26+
- reopened
27+
branches:
28+
- main
29+
push:
30+
branches:
31+
- main
32+
jobs:
33+
build:
34+
name: Build and Test
35+
runs-on: ubuntu-latest
36+
permissions:
37+
contents: read
38+
steps:
39+
- name: Checkout Code
40+
uses: actions/checkout@v4
41+
- name: Setup Rust Toolchain
42+
uses: actions-rust-lang/setup-rust-toolchain@v1
43+
with:
44+
toolchain: stable
45+
- name: Cargo Test
46+
run: cargo test --all-features --workspace
47+
lint:
48+
name: Lint
49+
runs-on: ubuntu-latest
50+
permissions:
51+
contents: read
52+
steps:
53+
- name: Checkout Code
54+
uses: actions/checkout@v4
55+
- name: Setup Rust Toolchain
56+
uses: actions-rust-lang/setup-rust-toolchain@v1
57+
with:
58+
toolchain: nightly
59+
components: clippy, rustfmt
60+
- name: Cargo Fmt
61+
run: cargo +nightly fmt --all --check
62+
- name: Cargo Clippy
63+
run: cargo +nightly clippy --all-features --workspace -- -D warnings
64+
release:
65+
needs:
66+
- build
67+
- lint
68+
if: ${{ github.ref == 'refs/heads/main' && github.event_name == 'push' }}
69+
name: Release
70+
runs-on: ubuntu-latest
71+
permissions:
72+
contents: write
73+
pull-requests: write
74+
packages: write
75+
env:
76+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
77+
CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }}
78+
steps:
79+
- name: Checkout Code
80+
uses: actions/checkout@v4
81+
- name: Release Plz
82+
uses: release-plz/action@v0.5
83+
with:
84+
command: release
85+
concurrency:
86+
group: release-${{github.ref}}
87+
cancel-in-progress: false
88+
release-pr:
89+
needs:
90+
- build
91+
- lint
92+
if: ${{ github.ref == 'refs/heads/main' && github.event_name == 'push' }}
93+
name: Release Pr
94+
runs-on: ubuntu-latest
95+
permissions:
96+
contents: write
97+
pull-requests: write
98+
packages: write
99+
env:
100+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
101+
CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }}
102+
steps:
103+
- name: Checkout Code
104+
uses: actions/checkout@v4
105+
- name: Release Plz
106+
uses: release-plz/action@v0.5
107+
with:
108+
command: release-pr
109+
concurrency:
110+
group: release-${{github.ref}}
111+
cancel-in-progress: false

0 commit comments

Comments
 (0)