-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
29 changed files
with
4,765 additions
and
4,968 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,58 +1,58 @@ | ||
# https://github.com/BamPeers/rust-ci-github-actions-workflow | ||
|
||
on: | ||
pull_request: | ||
types: [ opened, synchronize, reopened, edited, unlocked, review_requested ] | ||
push: | ||
branches: | ||
- main | ||
|
||
|
||
name: Check and Lint | ||
|
||
jobs: | ||
check: | ||
name: Check | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- uses: actions-rs/toolchain@v1 | ||
with: | ||
profile: minimal | ||
toolchain: stable | ||
override: true | ||
- uses: actions-rs/cargo@v1 | ||
with: | ||
command: check | ||
|
||
fmt: | ||
name: Rustfmt | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- uses: actions-rs/toolchain@v1 | ||
with: | ||
profile: minimal | ||
toolchain: stable | ||
override: true | ||
- run: rustup component add rustfmt | ||
- uses: actions-rs/cargo@v1 | ||
with: | ||
command: fmt | ||
args: --all -- --check | ||
|
||
clippy: | ||
name: Clippy | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- uses: actions-rs/toolchain@v1 | ||
with: | ||
toolchain: stable | ||
components: clippy | ||
override: true | ||
- uses: actions-rs/clippy-check@v1 | ||
with: | ||
token: ${{ secrets.GITHUB_TOKEN }} | ||
args: --all-features | ||
name: Clippy Output | ||
# https://github.com/BamPeers/rust-ci-github-actions-workflow | ||
|
||
on: | ||
pull_request: | ||
types: [ opened, synchronize, reopened, edited, unlocked, review_requested ] | ||
push: | ||
branches: | ||
- main | ||
|
||
|
||
name: Check and Lint | ||
|
||
jobs: | ||
check: | ||
name: Check | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- uses: actions-rs/toolchain@v1 | ||
with: | ||
profile: minimal | ||
toolchain: stable | ||
override: true | ||
- uses: actions-rs/cargo@v1 | ||
with: | ||
command: check | ||
|
||
fmt: | ||
name: Rustfmt | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- uses: actions-rs/toolchain@v1 | ||
with: | ||
profile: minimal | ||
toolchain: stable | ||
override: true | ||
- run: rustup component add rustfmt | ||
- uses: actions-rs/cargo@v1 | ||
with: | ||
command: fmt | ||
args: --all -- --check | ||
|
||
clippy: | ||
name: Clippy | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- uses: actions-rs/toolchain@v1 | ||
with: | ||
toolchain: stable | ||
components: clippy | ||
override: true | ||
- uses: actions-rs/clippy-check@v1 | ||
with: | ||
token: ${{ secrets.GITHUB_TOKEN }} | ||
args: --all-features | ||
name: Clippy Output |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,54 +1,54 @@ | ||
name: Publish to Crates | ||
|
||
on: | ||
push: | ||
tags: | ||
- "*.*.*" | ||
|
||
jobs: | ||
update_and_publish: | ||
name: Update Cargo.toml Version and Publish to Crates | ||
runs-on: ubuntu-latest | ||
environment: crates | ||
|
||
|
||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v2 | ||
|
||
- name: Pull changes | ||
run: git pull origin main | ||
|
||
- name: Set up Rust | ||
uses: moonrepo/setup-rust@v1 | ||
|
||
- name: Format Code | ||
run: cargo fmt --all | ||
|
||
- name: Lint Code | ||
run: cargo clippy --all -- -D warnings | ||
|
||
- name: Update Cargo.toml Version | ||
run: | | ||
VERSION=$(echo "${GITHUB_REF#refs/tags/}") | ||
sed -i'' -e "s/^version = \".*\"/version = \"$VERSION\"/" Cargo.toml | ||
git config --local user.email "action@github.com" | ||
git config --local user.name "GitHub Action" | ||
if ! git diff --quiet; then | ||
git commit -am "Bump version to $VERSION" | ||
else | ||
echo "No changes to commit" | ||
fi | ||
- name: Pull changes | ||
run: git pull origin main | ||
|
||
- name: Push changes | ||
uses: ad-m/github-push-action@master | ||
with: | ||
github_token: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- name: Login to Cargo and Publish | ||
run: cargo publish --token ${CRATES_TOKEN} | ||
env: | ||
CRATES_TOKEN: ${{ secrets.CRATES_TOKEN }} | ||
name: Publish to Crates | ||
|
||
on: | ||
push: | ||
tags: | ||
- "*.*.*" | ||
|
||
jobs: | ||
update_and_publish: | ||
name: Update Cargo.toml Version and Publish to Crates | ||
runs-on: ubuntu-latest | ||
environment: crates | ||
|
||
|
||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v2 | ||
|
||
- name: Pull changes | ||
run: git pull origin main | ||
|
||
- name: Set up Rust | ||
uses: moonrepo/setup-rust@v1 | ||
|
||
- name: Format Code | ||
run: cargo fmt --all | ||
|
||
- name: Lint Code | ||
run: cargo clippy --all -- -D warnings | ||
|
||
- name: Update Cargo.toml Version | ||
run: | | ||
VERSION=$(echo "${GITHUB_REF#refs/tags/}") | ||
sed -i'' -e "s/^version = \".*\"/version = \"$VERSION\"/" Cargo.toml | ||
git config --local user.email "action@github.com" | ||
git config --local user.name "GitHub Action" | ||
if ! git diff --quiet; then | ||
git commit -am "Bump version to $VERSION" | ||
else | ||
echo "No changes to commit" | ||
fi | ||
- name: Pull changes | ||
run: git pull origin main | ||
|
||
- name: Push changes | ||
uses: ad-m/github-push-action@master | ||
with: | ||
github_token: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- name: Login to Cargo and Publish | ||
run: cargo publish --token ${CRATES_TOKEN} | ||
env: | ||
CRATES_TOKEN: ${{ secrets.CRATES_TOKEN }} |
Oops, something went wrong.