diff --git a/.gitignore b/.gitignore index 3caeea8..036c904 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,3 @@ /target -temp \ No newline at end of file +temp +.idea \ No newline at end of file diff --git a/Cargo.toml b/Cargo.toml index 3114bdb..de295e4 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -2,8 +2,8 @@ name = "codeanalyzer-rs" version = "0.1.0" edition = "2021" -authors = ["Rithul Kamesh "] -description = "A code analysis tool written in Rust" +authors = ["Rithul Kamesh ", "Rahul Krishna "] +description = "A code analysis tool written in Rust for Rust" license = "Apache-2.0" repository = "https://github.com/codellm-devkit/codeanalyzer-rs" readme = "README.md" diff --git a/src/.github/workflows/release.yml b/src/.github/workflows/release.yml new file mode 100644 index 0000000..f30a343 --- /dev/null +++ b/src/.github/workflows/release.yml @@ -0,0 +1,66 @@ +name: Rust Release + +on: + push: + tags: + - "v*.*.*" + +permissions: + contents: write + +jobs: + release: + runs-on: ubuntu-latest + + steps: + - name: Check out code + uses: actions/checkout@v4 + + - name: Set up Rust + uses: dtolnay/rust-toolchain@stable + with: + toolchain: stable + + - name: Cache dependencies + uses: Swatinem/rust-cache@v2 + + - name: Build and Test + id: build + continue-on-error: true # Allow the workflow to continue if this fails + run: | + cargo build --release + cargo test --release + + - name: Delete tag on failure + if: steps.build.outcome != 'success' + run: | + git push --delete origin ${GITHUB_REF#refs/tags/} + exit 1 # Fail the workflow + + - name: Build Changelog + id: gen_changelog + uses: mikepenz/release-changelog-builder-action@v5 + with: + failOnError: "true" + configuration: .github/workflows/release_config.json + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + + - name: Package Release Assets + run: | + cd target/release + # For Linux + tar -czf ../../my-app-linux.tar.gz my-app + # For Windows (if cross-compilation is set up) + # zip ../../my-app-windows.zip my-app.exe + cd ../.. + + - name: Publish Release + uses: softprops/action-gh-release@v1 + with: + files: | + my-app-linux.tar.gz + # my-app-windows.zip + body: ${{ steps.gen_changelog.outputs.changelog }} + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} \ No newline at end of file diff --git a/src/.github/workflows/release_config.json b/src/.github/workflows/release_config.json new file mode 100644 index 0000000..7ddd165 --- /dev/null +++ b/src/.github/workflows/release_config.json @@ -0,0 +1,35 @@ +{ + "categories": [ + { + "title": "## 🚀 Features", + "labels": ["kind/feature", "enhancement"] + }, + { + "title": "## 🐛 Fixes", + "labels": ["fix", "bug"] + }, + { + "title": "## ♻️ Refactoring", + "labels": ["refactoring"] + }, + { + "title": "## ⚡️ Performance Improvements", + "labels": ["performance"] + }, + { + "title": "## \uD83D\uDCDA Documentation", + "labels": ["documentation", "doc"] + }, + { + "title": "## \uD83D\uDEA6 Tests", + "labels": ["test"] + }, + { + "title": "## \uD83D\uDEE0 Other Updates", + "labels": ["other", "kind/dependency-change"] + } + ], + "ignore_labels": [ + "ignore" + ] +} \ No newline at end of file