-
Notifications
You must be signed in to change notification settings - Fork 31
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(version): add version information to cli (#336)
* feat(version): add version information to cli * feat(version): add version check for release * fix(typo): wrong variable name * refactor(workflow): separated check version into its own workflow --------- Co-authored-by: Gabriel Guerra <[email protected]>
- Loading branch information
Showing
3 changed files
with
53 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
name: Check Release Version | ||
|
||
on: | ||
workflow_call: | ||
workflow_dispatch: | ||
|
||
permissions: | ||
contents: write | ||
|
||
jobs: | ||
check-version: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Check out repository | ||
uses: actions/checkout@v4 | ||
|
||
- name: Install Nix | ||
uses: DeterminateSystems/nix-installer-action@v11 | ||
|
||
- name: Use Magic Nix Cache | ||
uses: DeterminateSystems/magic-nix-cache-action@v6 | ||
|
||
- name: Build Resonate binary | ||
run: | | ||
# Build resonate binary | ||
nix build ".#resonate" | ||
# Copy into root | ||
cp ./result/bin/resonate resonate | ||
- name: Check version | ||
env: | ||
GITHUB_REF_VERSION: ${{ github.ref_name }} | ||
run: | | ||
# Extract resonate version | ||
RESONATE_VERSION=$(./resonate -v | awk '{print $3}') | ||
RESONATE_VERSION="v${RESONATE_VERSION}" | ||
# Compare versions | ||
if [ "$RESONATE_VERSION" != "$GITHUB_REF_VERSION" ]; then | ||
echo "Version mismatch: resonate version ($RESONATE_VERSION) does not match GitHub ref ($GITHUB_REF_VERSION)" | ||
exit 1 | ||
else | ||
echo "Version match: resonate version ($RESONATE_VERSION) matches GitHub ref ($GITHUB_REF_VERSION)" | ||
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters