Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

✨ Add git commit hash in main branch build version #63

Merged
merged 8 commits into from
Jan 17, 2025
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
31 changes: 11 additions & 20 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ name: Build
on:
push:
branches: ["main"]
tags: ["*"]

env:
CARGO_TERM_COLOR: always
Expand Down Expand Up @@ -32,36 +33,26 @@ jobs:
- name: Build
run: cargo build --release

- name: Get git commit hash (Windows)
- name: Get version (Windows)
if: ${{ contains('Windows', runner.os) }}
id: hash_windows
run: echo "hash=$("${{ github.sha }}".SubString(0, 10))" >> $env:GITHUB_OUTPUT
id: version_windows
run: echo "version=$(git describe --tags --dirty)" >> $env:GITHUB_OUTPUT

- name: Get git commit hash
- name: Get version
if: ${{ !contains('Windows', runner.os) }}
id: hash
run: echo "hash=${GITHUB_SHA:0:10}" >> $GITHUB_OUTPUT

- name: Rename artifact (Windows)
if: ${{ contains('Windows', runner.os) }}
run: mv target/release/mltd.exe mltd-git-${{ steps.hash_windows.outputs.hash }}-Windows.exe

- name: Rename artifact
if: ${{ !contains('Windows', runner.os) }}
run: |
chmod +x target/release/mltd
mv target/release/mltd mltd-git-${{ steps.hash.outputs.hash }}-${{ runner.os }}
id: version
run: echo "version=$(git describe --tags --dirty)" >> $GITHUB_OUTPUT

- name: Publish artifact (Windows)
if: ${{ contains('Windows', runner.os) }}
uses: actions/upload-artifact@v4
with:
name: mltd-git-${{ steps.hash_windows.outputs.hash }}-Windows.exe
path: mltd-git-${{ steps.hash_windows.outputs.hash }}-Windows.exe
name: mltd-git-${{ steps.version_windows.outputs.version }}-Windows.exe
path: target/release/mltd.exe

- name: Publish artifact
if: ${{ !contains('Windows', runner.os) }}
uses: actions/upload-artifact@v4
with:
name: mltd-git-${{ steps.hash.outputs.hash }}-${{ runner.os }}
path: mltd-git-${{ steps.hash.outputs.hash }}-${{ runner.os }}
name: mltd-git-${{ steps.version.outputs.version }}-${{ runner.os }}
path: target/release/mltd
1 change: 1 addition & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
[submodule "crates/vgmstream-sys/vgmstream"]
path = crates/vgmstream-sys/vgmstream
url = https://github.com/vgmstream/vgmstream.git
ignore = dirty
229 changes: 228 additions & 1 deletion Cargo.lock

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

9 changes: 7 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ repository = "https://github.com/nicks96432/mltd-asset-downloader"

[package]
authors = { workspace = true }
build = "build.rs"
categories = ["command-line-utilities"]
description = "A CLI made for assets in THE iDOLM@STER® MILLION LIVE! THEATER DAYS (MLTD)"
edition = { workspace = true }
Expand Down Expand Up @@ -47,10 +48,14 @@ rmp-serde = "1.3.0"
serde = { features = ["derive"], version = "1.0.217" }
texture2ddecoder = { optional = true, version = "0.1.1" }
thiserror = "2.0.10"
tokio = { version = "1.43.0", features = ["macros", "rt-multi-thread"] }
tokio-util = { version = "0.7.13", features = ["compat"] }
tokio = { features = ["macros", "rt-multi-thread"], version = "1.43.0" }
tokio-util = { features = ["compat"], version = "0.7.13" }
vgmstream = { optional = true, path = "crates/vgmstream" }

[build-dependencies]
vergen = { features = ["cargo", "emit_and_set", "rustc"], version = "9.0.4" }
vergen-gitcl = { version = "1.0.5" }

[dev-dependencies]
ctor = "0.2.9"
rand = "0.8.5"
Expand Down
Loading
Loading