add version flag and interaction to make users not run the program as sudo :3

This commit is contained in:
LilliaElaine
2025-10-23 02:15:20 -04:00
parent 0048948102
commit 8dc0e85dbc
2 changed files with 82 additions and 5 deletions

View File

@ -12,7 +12,7 @@ on:
permissions:
contents: write
jobs:
build:
build-package:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
@ -25,10 +25,15 @@ jobs:
- name: install libusb
run: sudo apt update && sudo apt install -y libusb-1.0-0-dev
- name: Build
run: go build -v ./...
- name: Build Release
run: go build -v -ldflags "-X main.gitVersion=${{ github.ref_name }}" ./...
if: github.ref_type == 'tag'
- name: Release
- name: Build Non-Release
run: go build ./...
if: github.ref_type != 'tag'
- name: Release Binary
uses: softprops/action-gh-release@v2
if: github.ref_type == 'tag'
with: