45 lines
1.1 KiB
YAML
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
|