Skip to content

Commit

Permalink
Update rust.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
RustamIrzaev committed Jun 18, 2024
1 parent fcab022 commit 0974f9e
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions .github/workflows/rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name: Rust Build and Release
on:
push:
branches:
- main
- main # Change this to your main branch name if different

jobs:
build:
Expand All @@ -20,15 +20,17 @@ jobs:
profile: minimal
toolchain: stable

- name: Read Cargo.toml
id: read_cargo_toml
run: echo ::set-output name=version::$(grep -oP '(?<=version = ")[^"]*' Cargo.toml)
- name: Extract Version from Cargo.toml
id: extract_version
run: |
VERSION=$(grep -Po '(?<=^version = ")[^"]*' Cargo.toml | head -n1)
echo "::set-output name=version::${VERSION}"
- name: Build
run: |
cargo build --release
env:
APP_VERSION: ${{ steps.read_cargo_toml.outputs.version }}
APP_VERSION: ${{ steps.extract_version.outputs.version }}

- name: Package Binary
run: |
Expand All @@ -42,8 +44,8 @@ jobs:
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: v${{ steps.read_cargo_toml.outputs.version }}
release_name: Release v${{ steps.read_cargo_toml.outputs.version }}
tag_name: v${{ steps.extract_version.outputs.version }}
release_name: Release v${{ steps.extract_version.outputs.version }}
body: |
Release description goes here
draft: false
Expand Down

0 comments on commit 0974f9e

Please sign in to comment.