diff --git a/.gitea/workflows/publish-deb.yml b/.gitea/workflows/publish-deb.yml index 92807cf..922e055 100644 --- a/.gitea/workflows/publish-deb.yml +++ b/.gitea/workflows/publish-deb.yml @@ -49,10 +49,18 @@ jobs: run: cargo install cargo-deb - name: Build deb package + env: + CREATE_DEB_DEBUG: "1" run: | - ./create-deb.sh \ - ${{ inputs.deb_version != "" && "--deb-version " + inputs.deb_version || "" }} \ - ${{ inputs.deb_revision != "" && "--deb-revision " + inputs.deb_revision || "" }} + CREATE_DEB_ARGS=( + --deb-revision "${{ inputs.deb_revision }}" + ) + + if [ "${{ inputs.deb_version }}" != "" ]; then + CREATE_DEB_ARGS+=("--deb-version" "${{ inputs.deb_version }}") + fi + + ./create-deb.sh "${CREATE_DEB_ARGS[@]}" - name: Upload deb package artifact uses: actions/upload-artifact@v3 diff --git a/create-deb.sh b/create-deb.sh index 310c5fd..9b5ca2f 100755 --- a/create-deb.sh +++ b/create-deb.sh @@ -2,6 +2,20 @@ set -euo pipefail +if [[ "${CREATE_DEB_DEBUG:-}" == "1" ]]; then + set -x +fi + +if ! command -v cargo &> /dev/null; then + echo "cargo could not be found" >&2 + exit 1 +fi + +if ! command -v cargo-deb &> /dev/null; then + echo "cargo-deb could not be found" >&2 + exit 1 +fi + cargo build --release mkdir -p assets/completions