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: 7 additions & 30 deletions .github/workflows/auto-release-on-merge.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ jobs:
runs-on: ubuntu-latest
outputs:
release_tag: ${{ steps.get_version.outputs.version_tag }}
release_created: ${{ steps.check_create_release.outputs.release_created }}
steps:
- name: Checkout Code
uses: actions/checkout@v4
Expand All @@ -27,49 +28,25 @@ jobs:
echo "Found version: $VERSION"
echo "version_tag=v$VERSION" >> "$GITHUB_OUTPUT"

- name: Generate Release Notes
env:
TAG: ${{ steps.get_version.outputs.version_tag }}
run: |
cat > release_notes.md <<'EOF'
# PureCode $TAG

## Highlights
- Add a few concise bullets about the most impactful changes.

## Fixes
- Note bug fixes or quality improvements worth calling out.

## Compatibility
- Breaking changes: none.
- Minimum supported Rust: stable.

## Install
```bash
curl -LsSf https://raw.githubusercontent.com/isupervillain/purecode/main/install.sh | sh
```

```powershell
powershell -ExecutionPolicy ByPass -c "irm https://raw.githubusercontent.com/isupervillain/purecode/main/install.ps1 | iex"
```
EOF

- name: Check and Create Release
id: check_create_release
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
TAG: ${{ steps.get_version.outputs.version_tag }}
SHA: ${{ github.event.pull_request.merge_commit_sha }}
run: |
if gh release view "$TAG" > /dev/null 2>&1; then
echo "Error: Release $TAG already exists."
exit 1
echo "Release $TAG already exists. Skipping creation."
echo "release_created=false" >> "$GITHUB_OUTPUT"
else
echo "Creating release $TAG for commit $SHA"
gh release create "$TAG" --target "$SHA" --notes-file release_notes.md
gh release create "$TAG" --target "$SHA" --generate-notes
echo "release_created=true" >> "$GITHUB_OUTPUT"
fi

build_and_upload:
needs: prepare_release
if: needs.prepare_release.outputs.release_created == 'true'
name: Build and Upload Assets
runs-on: ${{ matrix.os }}
defaults:
Expand Down
9 changes: 9 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,15 @@ jobs:
uses: dtolnay/rust-toolchain@stable
with:
toolchain: stable
components: clippy, rustfmt

- name: Check Formatting
if: matrix.os == 'ubuntu-latest'
run: cargo fmt --check

- name: Run Clippy
if: matrix.os == 'ubuntu-latest'
run: cargo clippy -- -D warnings

- name: Build Release
run: cargo build --release
Expand Down
183 changes: 182 additions & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 7 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,8 +1,13 @@
[package]
name = "purecode"
version = "0.1.0"
version = "0.2.0"
edition = "2021"

[dependencies]
clap = { version = "4.4", features = ["derive"] }
clap = { version = "4.4", features = ["derive", "env"] }
colored = "3.0.0"
serde = { version = "1.0", features = ["derive"] }
serde_json = "1.0"
toml = "0.8"
walkdir = "2.4"
glob = "0.3"
Loading
Loading