Switch to creating releases by tag (#244)

This commit is contained in:
Christiaan Goossens
2026-04-14 14:26:02 +02:00
committed by GitHub
parent 67f58a39aa
commit 6f1d2bcb3f

View File

@@ -1,9 +1,9 @@
name: Build and upload draft release asset name: Build and create draft release
on: on:
release: push:
types: tags:
- created - v*.*.*
jobs: jobs:
release: release:
@@ -14,31 +14,14 @@ jobs:
steps: steps:
- uses: actions/checkout@v6 - uses: actions/checkout@v6
with:
fetch-depth: 0
ref: ${{ github.event.release.target_commitish }}
- name: Create tag if missing
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
tag_name="${{ github.event.release.tag_name }}"
if git rev-parse --verify --quiet "refs/tags/${tag_name}" >/dev/null; then
echo "Tag ${tag_name} already exists"
exit 0
fi
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"
git tag "${tag_name}"
git push origin "${tag_name}"
- name: Build - name: Build
run: scripts/build run: scripts/build
- name: Upload build to draft release - name: Create or update draft release with ZIP
env: uses: softprops/action-gh-release@v3
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} with:
run: | draft: true
gh release upload "${{ github.event.release.tag_name }}" ./hass-oidc-auth.zip --clobber fail_on_unmatched_files: true
generate_release_notes: true
files: ./hass-oidc-auth.zip