diff --git a/.github/workflows/actions.yml b/.github/workflows/actions.yml index 5552ab6..f1675bd 100644 --- a/.github/workflows/actions.yml +++ b/.github/workflows/actions.yml @@ -64,7 +64,7 @@ jobs: - name: ✍🏻 Create .HA_VERSION file run: | mkdir -p ${{ matrix.target.path }} - echo "3000.1.1" > ${{ matrix.target.path }}/.HA_VERSION + echo "2026.10.0" > ${{ matrix.target.path }}/.HA_VERSION - name: 🏃‍♀️ Run the downloader run: bash ./get @@ -91,6 +91,11 @@ jobs: - { current: "2022.1.1", target: "2023.1.1", result: 1 } - { current: "2022.1.1", target: "2023.1.3", result: 1 } - { current: "2023.12.0", target: "2023.1.3", result: 1 } + - { current: "2026.10.5", target: "2023.1.1", result: 0 } + - { current: "2026.11.0", target: "2023.1.1", result: 1 } + - { current: "2026.11.0b0", target: "2023.1.1", result: 1 } + - { current: "2026.12.0.dev20261101", target: "2023.1.1", result: 1 } + - { current: "2027.1.0", target: "2023.1.1", result: 1 } steps: - name: Checkout the repository @@ -133,4 +138,42 @@ jobs: run: | if [ -f "${{ matrix.target.path }}/custom_components/hacs.zip" ]; then exit 1 - fi \ No newline at end of file + fi + + marketplace: + needs: lint + name: Validate Marketplace message for ${{ matrix.version.current }} + runs-on: ubuntu-latest + strategy: + matrix: + version: + - { current: "2026.11.0", url: "https://www.home-assistant.io/integrations/marketplace" } + - { current: "2026.11.0b1", url: "https://rc.home-assistant.io/integrations/marketplace" } + - { current: "2026.12.0.dev20261101", url: "https://next.home-assistant.io/integrations/marketplace" } + + steps: + - name: Checkout the repository + uses: actions/checkout@v6.0.3 + + - name: Create .HA_VERSION file + run: echo "${{ matrix.version.current }}" > .HA_VERSION + + - name: Run the script and check result + run: | + set +e + output=$(bash ./get 2>&1) + result=$? + set -e + echo "$output" + if [ "$result" != 1 ]; then + exit 1 + fi + if ! echo "$output" | grep -qF "${{ matrix.version.url }}"; then + exit 1 + fi + + - name: 👀 Verify nothing was downloaded + run: | + if [ -e "./custom_components" ]; then + exit 1 + fi diff --git a/get b/get index 9156d6f..b6b538e 100644 --- a/get +++ b/get @@ -19,6 +19,7 @@ function run() { "/usr/share/hassio/homeassistant" ) declare currentVersion + declare marketplaceDocs declare currentYear declare currentMonth declare currentPatch @@ -53,6 +54,21 @@ function run() { if [ -n "$haPath" ]; then info "Found Home Assistant configuration directory at '$haPath'" + currentVersion=$(cat "$haPath/.HA_VERSION") + currentYear=$(echo "${currentVersion}" | cut -d "." -f 1) + currentMonth=$(echo "${currentVersion}" | cut -d "." -f 2) + + if [ "${currentYear}" -gt 2026 ] || { [ "${currentYear}" -eq 2026 ] && [ "${currentMonth}" -ge 11 ]; }; then + if [[ "${currentVersion}" == *dev* ]]; then + marketplaceDocs="https://next.home-assistant.io/integrations/marketplace" + elif [[ "${currentVersion}" == *b* ]]; then + marketplaceDocs="https://rc.home-assistant.io/integrations/marketplace" + else + marketplaceDocs="https://www.home-assistant.io/integrations/marketplace" + fi + error "HACS does not work on Home Assistant 2026.11 and newer (found ${currentVersion}), as it has been replaced by the native Marketplace integration. See ${marketplaceDocs}" + fi + cd "$haPath" || error "Could not change path to $haPath" if [ ! -d "$haPath/custom_components" ]; then info "Creating custom_components directory..." @@ -81,7 +97,6 @@ function run() { echo info "Verifying versions" targetVersion=$(sed -n -e '/^MINIMUM_HA_VERSION/p' "$haPath/custom_components/hacs/const.py" | cut -d '"' -f 2) - currentVersion=$(cat "$haPath/.HA_VERSION") info "Current version is ${currentVersion}, minimum version is ${targetVersion}"