Skip to content

Commit

Permalink
added yes no input prompt
Browse files Browse the repository at this point in the history
  • Loading branch information
Arteiii committed Jun 8, 2024
1 parent c4c3b21 commit 9823b7c
Show file tree
Hide file tree
Showing 29 changed files with 4,765 additions and 4,968 deletions.
116 changes: 58 additions & 58 deletions .github/workflows/check-and-lint.yml
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
108 changes: 54 additions & 54 deletions .github/workflows/publish_crate.yml
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 }}
Loading

0 comments on commit 9823b7c

Please sign in to comment.