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
37 changes: 37 additions & 0 deletions .github/workflows/changelog.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: Changelog

on:
workflow_dispatch:
push:
branches:
- main

permissions:
contents: write

jobs:
changelog:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 30

- name: Install git-cliff
uses: dtolnay/rust-toolchain@stable
with:
toolchain: stable

- name: Install git-cliff
run: cargo install git-cliff

- name: Generate changelog
run: git-cliff --config git-cliff.toml --output CHANGELOG.md

- name: Commit changelog
run: |
git config --local user.email "github-actions[bot]@users.noreply.github.com"
git config --local user.name "github-actions[bot]"
git add CHANGELOG.md
git diff --staged --quiet || git commit -m "docs: update changelog"
git push
50 changes: 50 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
name: CI

on:
push:
branches:
- main
- master
- release/**
pull_request:
branches:
- main
- master
- release/**

permissions:
contents: read

jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

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

- name: Cache cargo
uses: Swatinem/rust-cache@v2

- name: Run tests
run: cargo test --all-features

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

- name: Check formatting
run: cargo fmt --check

lint-workflows:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: Install actionlint
run: |
curl -sL https://raw.githubusercontent.com/rhysd/actionlint/main/scripts/download-actionlint.bash | bash
mv actionlint ~/.local/bin/

- name: Lint workflows
run: actionlint .github/workflows/*.yml
54 changes: 54 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
name: Release

on:
push:
branches:
- release/**
paths-ignore:
- 'docs/**'
- '**.md'

permissions:
contents: write

jobs:
release:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0

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

- name: Install git-cliff
run: cargo install git-cliff

- name: Build release
run: cargo build --release

- name: Extract version
id: version
run: echo "VERSION=$(cargo metadata --format-version=1 --no-deps | jq -r '.packages[0].version')" >> "$GITHUB_OUTPUT"

- name: Generate changelog
id: changelog
run: |
git-cliff --config git-cliff.toml --output CHANGELOG.md
cat CHANGELOG.md >> "$GITHUB_STEP_SUMMARY"

- name: Create Tag
run: |
git tag "v${{ steps.version.outputs.VERSION }}"
git push origin "v${{ steps.version.outputs.VERSION }}"

- name: Create GitHub Release
uses: softprops/action-gh-release@v2
with:
tag_name: v${{ steps.version.outputs.VERSION }}
name: BitPill v${{ steps.version.outputs.VERSION }}
body_path: CHANGELOG.md
draft: true
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Loading
Loading