Skip to content

Commit

Permalink
add Version display in app
Browse files Browse the repository at this point in the history
  • Loading branch information
markusdd committed Mar 15, 2024
1 parent ff66964 commit 7594dc9
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 10 deletions.
16 changes: 8 additions & 8 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,15 +48,15 @@ jobs:
- id: get_version
run: echo "VERSION=$(cat ./version/version)" >> $GITHUB_OUTPUT
shell: bash
- uses: actions/cache@v1
- uses: actions/cache@master
with:
path: ~/.cargo/registry
key: '${{ runner.os }}-cargo-registry-${{ hashFiles(''**/Cargo.lock'') }}'
- uses: actions/cache@v1
- uses: actions/cache@master
with:
path: ~/.cargo/git
key: '${{ runner.os }}-cargo-index-${{ hashFiles(''**/Cargo.lock'') }}'
- uses: actions/cache@v1
- uses: actions/cache@master
with:
path: target
key: ${{ runner.os }}-cargo-build-target-${{ hashFiles('**/Cargo.lock') }}
Expand Down Expand Up @@ -117,39 +117,39 @@ jobs:
toolchain: stable
override: true
- id: create_release
uses: actions/create-release@v1.0.0
uses: actions/create-release@latest
env:
GITHUB_TOKEN: '${{ secrets.GITHUB_TOKEN }}'
with:
tag_name: '${{ steps.get_version.outputs.VERSION }}'
release_name: 'Release ${{ steps.get_version.outputs.VERSION }}'
draft: false
prerelease: false
- uses: actions/upload-release-asset@v1.0.1
- uses: actions/upload-release-asset@latest
env:
GITHUB_TOKEN: '${{ secrets.GITHUB_TOKEN }}'
with:
upload_url: '${{ steps.create_release.outputs.upload_url }}'
asset_path: ./${{ steps.get_repository_name.outputs.REPOSITORY_NAME }}-x86_64-unknown-linux-gnu/easyeda_to_kicad_lib_ui
asset_name: ${{ steps.get_repository_name.outputs.REPOSITORY_NAME }}-x86_64-unknown-linux-gnu
asset_content_type: application/octet-stream
- uses: actions/upload-release-asset@v1.0.1
- uses: actions/upload-release-asset@latest
env:
GITHUB_TOKEN: '${{ secrets.GITHUB_TOKEN }}'
with:
upload_url: '${{ steps.create_release.outputs.upload_url }}'
asset_path: ./${{ steps.get_repository_name.outputs.REPOSITORY_NAME }}-x86_64-apple-darwin/easyeda_to_kicad_lib_ui
asset_name: ${{ steps.get_repository_name.outputs.REPOSITORY_NAME }}-x86_64-apple-darwin
asset_content_type: application/octet-stream
- uses: actions/upload-release-asset@v1.0.1
- uses: actions/upload-release-asset@latest
env:
GITHUB_TOKEN: '${{ secrets.GITHUB_TOKEN }}'
with:
upload_url: '${{ steps.create_release.outputs.upload_url }}'
asset_path: ./${{ steps.get_repository_name.outputs.REPOSITORY_NAME }}-aarch64-apple-darwin/easyeda_to_kicad_lib_ui
asset_name: ${{ steps.get_repository_name.outputs.REPOSITORY_NAME }}-aarch64-apple-darwin
asset_content_type: application/octet-stream
- uses: actions/upload-release-asset@v1.0.1
- uses: actions/upload-release-asset@latest
env:
GITHUB_TOKEN: '${{ secrets.GITHUB_TOKEN }}'
with:
Expand Down
2 changes: 1 addition & 1 deletion Cargo.lock

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

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "easyeda_to_kicad_lib_ui"
version = "1.1.0"
version = "1.1.2"
authors = ["Markus Krause <[email protected]>"]
edition = "2021"
rust-version = "1.72"
Expand Down
3 changes: 3 additions & 0 deletions src/app.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ use regex::Regex;
use subprocess::Exec;
use tempdir::TempDir;

const VERSION: &str = env!("CARGO_PKG_VERSION");

/// We derive Deserialize/Serialize so we can persist app state on shutdown.
#[derive(serde::Deserialize, serde::Serialize)]
#[serde(default)] // if we add new fields, give them default values when deserializing old state
Expand Down Expand Up @@ -475,6 +477,7 @@ impl eframe::App for MyApp {

ui.with_layout(egui::Layout::bottom_up(egui::Align::LEFT), |ui| {
powered_by(ui);
ui.label(format!("Version: v{}", VERSION));
egui::warn_if_debug_build(ui);
});

Expand Down

0 comments on commit 7594dc9

Please sign in to comment.