From ff4ec6dd46c6e805a64793a4c0285d00feb89d27 Mon Sep 17 00:00:00 2001 From: Rahul Krishna Date: Thu, 13 Feb 2025 15:20:53 -0500 Subject: [PATCH 1/4] Add release automation. Signed-off-by: Rahul Krishna --- .idea/.gitignore | 8 ++++ .idea/codeanalyzer-rs.iml | 11 ++++++ .idea/modules.xml | 8 ++++ .idea/vcs.xml | 6 +++ src/.github/workflows/release.yml | 66 +++++++++++++++++++++++++++++++ 5 files changed, 99 insertions(+) create mode 100644 .idea/.gitignore create mode 100644 .idea/codeanalyzer-rs.iml create mode 100644 .idea/modules.xml create mode 100644 .idea/vcs.xml create mode 100644 src/.github/workflows/release.yml diff --git a/.idea/.gitignore b/.idea/.gitignore new file mode 100644 index 0000000..13566b8 --- /dev/null +++ b/.idea/.gitignore @@ -0,0 +1,8 @@ +# Default ignored files +/shelf/ +/workspace.xml +# Editor-based HTTP Client requests +/httpRequests/ +# Datasource local storage ignored files +/dataSources/ +/dataSources.local.xml diff --git a/.idea/codeanalyzer-rs.iml b/.idea/codeanalyzer-rs.iml new file mode 100644 index 0000000..cf84ae4 --- /dev/null +++ b/.idea/codeanalyzer-rs.iml @@ -0,0 +1,11 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/modules.xml b/.idea/modules.xml new file mode 100644 index 0000000..aee25cd --- /dev/null +++ b/.idea/modules.xml @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/.idea/vcs.xml b/.idea/vcs.xml new file mode 100644 index 0000000..35eb1dd --- /dev/null +++ b/.idea/vcs.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file 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 From f515122b808065f4fe9427a1e19430f37072dbe5 Mon Sep 17 00:00:00 2001 From: Rahul Krishna Date: Thu, 13 Feb 2025 15:21:19 -0500 Subject: [PATCH 2/4] Add release automation. Signed-off-by: Rahul Krishna --- .gitignore | 3 ++- .idea/.gitignore | 8 -------- .idea/codeanalyzer-rs.iml | 11 ----------- .idea/modules.xml | 8 -------- .idea/vcs.xml | 6 ------ 5 files changed, 2 insertions(+), 34 deletions(-) delete mode 100644 .idea/.gitignore delete mode 100644 .idea/codeanalyzer-rs.iml delete mode 100644 .idea/modules.xml delete mode 100644 .idea/vcs.xml 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/.idea/.gitignore b/.idea/.gitignore deleted file mode 100644 index 13566b8..0000000 --- a/.idea/.gitignore +++ /dev/null @@ -1,8 +0,0 @@ -# Default ignored files -/shelf/ -/workspace.xml -# Editor-based HTTP Client requests -/httpRequests/ -# Datasource local storage ignored files -/dataSources/ -/dataSources.local.xml diff --git a/.idea/codeanalyzer-rs.iml b/.idea/codeanalyzer-rs.iml deleted file mode 100644 index cf84ae4..0000000 --- a/.idea/codeanalyzer-rs.iml +++ /dev/null @@ -1,11 +0,0 @@ - - - - - - - - - - - \ No newline at end of file diff --git a/.idea/modules.xml b/.idea/modules.xml deleted file mode 100644 index aee25cd..0000000 --- a/.idea/modules.xml +++ /dev/null @@ -1,8 +0,0 @@ - - - - - - - - \ No newline at end of file diff --git a/.idea/vcs.xml b/.idea/vcs.xml deleted file mode 100644 index 35eb1dd..0000000 --- a/.idea/vcs.xml +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file From 5fc7d11bc801c09b3d9316e8cc6248bb0e04ab7a Mon Sep 17 00:00:00 2001 From: Rahul Krishna Date: Thu, 13 Feb 2025 15:21:52 -0500 Subject: [PATCH 3/4] Add release automation. Signed-off-by: Rahul Krishna --- Cargo.toml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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" From ba9d6478a557140883cbd6f1c575faf7140ee5cb Mon Sep 17 00:00:00 2001 From: Rahul Krishna Date: Thu, 13 Feb 2025 15:22:35 -0500 Subject: [PATCH 4/4] Add release automation. Signed-off-by: Rahul Krishna --- src/.github/workflows/release_config.json | 35 +++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 src/.github/workflows/release_config.json 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