diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 5a2efda..9ad0876 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -13,19 +13,32 @@ jobs: id-token: write runs-on: ubuntu-latest steps: - - name: Get variables + - name: Checkout code + uses: actions/checkout@v4 + + - name: Get version from tag id: version - run: echo "::set-output name=version::${GITHUB_REF#refs/tags/}" + run: echo "version=${GITHUB_REF#refs/tags/}" >> $GITHUB_ENV - - uses: actions/checkout@v4 - with: - ref: ${{ steps.version.outputs.version }} + - name: Read version from YAML file + id: read_version + run: | + yaml_version=$(grep 'project_version:' esphome/components/basis.yaml | awk '{print $2}' | tr -d '"') + echo "yaml_version=$yaml_version" >> $GITHUB_ENV + + - name: Validate version consistency + id: validate_version + run: | + if [ "${yaml_version}" != "${version}" ]; then + echo "Tag version (${version}) does not match project_version (${yaml_version}) in YAML file." + exit 1 + fi - uses: release-drafter/release-drafter@v6.0.0 with: - tag: ${{ steps.version.outputs.version }} - name: ${{ steps.version.outputs.version }} - version: ${{ steps.version.outputs.version }} + tag: ${{ env.version }} + name: ${{ env.version }} + version: ${{ env.version }} publish: true env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN } \ No newline at end of file + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/sitemaps.yaml b/.github/workflows/sitemaps.yaml deleted file mode 100644 index 945d2c8..0000000 --- a/.github/workflows/sitemaps.yaml +++ /dev/null @@ -1,30 +0,0 @@ -name: Generate API sitemap - -on: - push: - branches: [ main ] - -jobs: - sitemap_job: - runs-on: ubuntu-latest - name: Generate a sitemap - - steps: - - name: Checkout the repo - uses: actions/checkout@v4 - with: - fetch-depth: 0 - - - name: Generate the sitemap - id: sitemap - uses: cicirello/generate-sitemap@v1 - with: - base-url-path: https://s0tool.nl/ -# path-to-root: static - - - - name: Output stats - run: | - echo "sitemap-path = ${{ steps.sitemap.outputs.sitemap-path }}" - echo "url-count = ${{ steps.sitemap.outputs.url-count }}" - echo "excluded-count = ${{ steps.sitemap.outputs.excluded-count }}" \ No newline at end of file