File tree 1 file changed +5
-6
lines changed
1 file changed +5
-6
lines changed Original file line number Diff line number Diff line change @@ -24,13 +24,12 @@ jobs:
24
24
25
25
- name : Generate Version 🏷️
26
26
id : version
27
+ shell : pwsh
27
28
run : |
28
- TAG_COUNT=$(git rev-list --tags --no-walk --count) # Count all tags
29
- COMMIT_COUNT=$(git rev-list --use-bitmap-index --count $(git rev-list --tags --no-walk --max-count=1)..HEAD) # Count all commits since the last tag
30
- NIXOS_VERSION=$(nix-instantiate --eval -E '(import ./.).inputs.nixpkgs.lib.version' | sed -E 's/"(.+\...).*"/\1/') # Get NixOS version from nixpkgs
31
- NIXOS_VERSION_MS=$(echo $NIXOS_VERSION | sed -E 's/\.0*(.+)/\.\1/') # Remove the leading 0 from the minor version (if it exists)
32
- NIXOS_WSL_VERSION=${NIXOS_VERSION_MS}.${TAG_COUNT}.${COMMIT_COUNT} # Compose the NixOS-WSL version number
33
- echo "version=$NIXOS_WSL_VERSION" >> $GITHUB_OUTPUT
29
+ $LATEST_TAG = git describe --tags --abbrev=0 # Get the latest tag name
30
+ $COMMIT_COUNT = git rev-list --use-bitmap-index --count $(git rev-list --tags --no-walk --max-count=1)..HEAD # Count all commits since the last tag
31
+ $NIXOS_WSL_VERSION = "$($LATEST_TAG -replace '(.+)\.(.+)\.(.+)\..+', '$1.$2.$3').${COMMIT_COUNT}" # Compose the NixOS-WSL version number
32
+ echo "version=$NIXOS_WSL_VERSION" >> $env:GITHUB_OUTPUT
34
33
35
34
echo $NIXOS_WSL_VERSION > ./VERSION
36
35
echo $(git rev-parse HEAD) >> ./VERSION
You can’t perform that action at this time.
0 commit comments