Skip to content

Add package.json version fallback to release workflows #215

@ScottMorris

Description

@ScottMorris

Context

threshold's release-build.yml has a useful pattern: when triggered via workflow_dispatch without a manual tag, it reads the version from package.json:

version="$(node -p "require('./apps/threshold/package.json').version")"

This repo's publish-desktop.yml requires a release_tag input for workflow_dispatch. There's no fallback to read the version from the workspace's package.json.

Proposal

Add a package.json version fallback to the prepare-release job:

if [[ "${GITHUB_EVENT_NAME}" == "workflow_dispatch" ]]; then
  TAG="${{ inputs.release_tag }}"
  if [[ -z "${TAG}" ]]; then
    TAG="desktop-v$(node -p "require('./apps/desktop/package.json').version")"
  fi
fi

Apply the same pattern to build-android.yml for android-v* tags.

Acceptance Criteria

  • workflow_dispatch inputs allow blank tag (fallback to package.json)
  • Desktop publish workflow reads version from apps/desktop/package.json
  • Android build workflow reads version similarly
  • Tag-triggered releases still work as before

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requestinfrastructureShared infrastructure and automation work

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions