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
66 changes: 66 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -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 }}
35 changes: 35 additions & 0 deletions .github/workflows/release_config.json
Original file line number Diff line number Diff line change
@@ -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"
]
}