Files
hass-oidc-auth/.github/workflows/release.yaml
Christiaan Goossens 67f58a39aa Better tag matching (#243)
* Better tag matching

* Split PR and release flows

* Undo PR archiving
2026-04-14 14:17:09 +02:00

45 lines
1.1 KiB
YAML

name: Build and upload draft release asset
on:
release:
types:
- created
jobs:
release:
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- 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
run: scripts/build
- name: Upload build to draft release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
gh release upload "${{ github.event.release.tag_name }}" ./hass-oidc-auth.zip --clobber