Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 0 additions & 30 deletions .github/workflows/build.yml

This file was deleted.

116 changes: 116 additions & 0 deletions .github/workflows/cd.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,116 @@
name: Continuous Delivery

on:
workflow_dispatch:
inputs:
version:
type: choice
required: true
description: 'Version number to bump'
options:
- patch
- minor
- major
pull_request:
branches:
- main
types:
- closed

permissions:
contents: write
issues: write
pull-requests: write

jobs:
publish-dry-run:
name: "Runs cargo publish --dry-run"
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v6

- name: Setup Rust
uses: dtolnay/rust-toolchain@stable

- name: Setup Rust Cache
uses: Swatinem/rust-cache@v2

- name: Setup Cargo Binstall
uses: cargo-bins/cargo-binstall@main

- name: Install Rust Binaries
run: cargo binstall -y --force cargo-tag

- name: Build (debug)
run: cargo b

- name: publish crate
run: |
cargo package --list --allow-dirty
cargo publish --dry-run --allow-dirty

release:
name: Create Release
needs: build-binaries
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v6

- name: Setup Rust
uses: dtolnay/rust-toolchain@stable

- name: Setup Rust Cache
uses: Swatinem/rust-cache@v2

- name: Setup Cargo Binstall
uses: cargo-bins/cargo-binstall@main

- name: Install Rust Binaries
run: cargo binstall -y --force cargo-tag

- name: Retrieve Git Commit SHA
run: echo "GIT_COMMIT_SHA7=$(git rev-parse --short ${{ github.sha }})" >> $GITHUB_ENV

- name: Commit Version Bump
run: |
git config --global user.name 'github-actions[bot]'
git config --global user.email 'github-actions[bot]@users.noreply.github.com'
if [ "${{ github.event_name }}" == "workflow_dispatch" ]; then
echo "CRATE_VERSION=$(cargo tag -p=v ${{ inputs.version }})" >> $GITHUB_ENV
else
echo "CRATE_VERSION=$(cargo tag -p=v prerelease pre.$GIT_COMMIT_SHA7)" >> $GITHUB_ENV
fi
git push origin main --follow-tags

- name: Login to Crates.io
run: cargo login ${CRATES_IO_TOKEN}
env:
CRATES_IO_TOKEN: ${{ secrets.CRATES_IO_TOKEN }}

- name: Publish crate
run: |
cargo package --list --allow-dirty
cargo publish --allow-dirty

- name: Download all artifacts
uses: actions/download-artifact@v4
with:
path: ./artifacts

- name: Create Release with GitHub CLI
env:
GH_TOKEN: ${{ github.token }}
run: |
# Determine if this is a pre-release
IS_PRERELEASE=""
if [ "${{ github.event_name }}" != "workflow_dispatch" ]; then
IS_PRERELEASE="--prerelease"
fi

# Create the release
gh release create "${{ env.CRATE_VERSION }}" \
--title "${{ env.CRATE_VERSION }}" \
--generate-notes \
$IS_PRERELEASE
32 changes: 32 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: build
on:
pull_request:
push:
branches:
- main

jobs:
build:
runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v6

- name: Setup Rust
uses: dtolnay/rust-toolchain@stable

- name: Setup Rust Cache
uses: Swatinem/rust-cache@v2

- name: Build
run: cargo b

- name: Run Formatter Check
run: cargo fmt -- --check

- name: Run Clippy Check
run: cargo clippy -- -D warnings

- name: Run Tests
run: cargo test
37 changes: 0 additions & 37 deletions .github/workflows/clippy.yml

This file was deleted.

21 changes: 0 additions & 21 deletions .github/workflows/dependabot-auto-approve.yml

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Dependabot auto-merge
name: Dependabot Automation
on: pull_request_target

permissions:
Expand All @@ -15,9 +15,16 @@ jobs:
uses: dependabot/fetch-metadata@v1.1.1
with:
github-token: "${{ secrets.GITHUB_TOKEN }}"

- name: Approve a PR
run: gh pr review --approve "$PR_URL"
env:
PR_URL: ${{github.event.pull_request.html_url}}
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}

- name: Enable auto-merge for Dependabot PRs
if: ${{steps.metadata.outputs.update-type == 'version-update:semver-patch'}}
run: gh pr merge --auto --merge "$PR_URL"
run: gh pr merge --auto --squash "$PR_URL"
env:
PR_URL: ${{github.event.pull_request.html_url}}
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
39 changes: 0 additions & 39 deletions .github/workflows/fmt.yml

This file was deleted.

43 changes: 0 additions & 43 deletions .github/workflows/release.yml

This file was deleted.

29 changes: 0 additions & 29 deletions .github/workflows/tests.yml

This file was deleted.

Loading