Release with autogenerated zip files (#242)
* Try autobuilding * Typo fix * Entire components dir * Directly upload zip
This commit is contained in:
committed by
GitHub
parent
baf3ac6b5a
commit
ddb2952e64
35
.github/workflows/release.yaml
vendored
Normal file
35
.github/workflows/release.yaml
vendored
Normal file
@@ -0,0 +1,35 @@
|
||||
name: Build release and add zip file
|
||||
|
||||
on:
|
||||
push:
|
||||
tags:
|
||||
- 'v[0-9]+\.[0-9]+\.[0-9]+'
|
||||
pull_request:
|
||||
|
||||
|
||||
jobs:
|
||||
release:
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
permissions:
|
||||
contents: write
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v6
|
||||
|
||||
- name: Build
|
||||
run: scripts/build
|
||||
|
||||
- name: Upload Artifact
|
||||
uses: actions/upload-artifact@v7
|
||||
with:
|
||||
path: ./hass-oidc-auth.zip
|
||||
archive: false
|
||||
if: ${{ github.event_name == 'pull_request' }}
|
||||
|
||||
- name: Upload build to existing release
|
||||
if: ${{ github.event_name == 'push' && github.ref_type == 'tag' }}
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
run: |
|
||||
gh release upload "${{ github.ref_name }}" ./hass-oidc-auth.zip --clobber
|
||||
3
.gitignore
vendored
3
.gitignore
vendored
@@ -111,5 +111,6 @@ dmypy.json
|
||||
|
||||
.pytest_logs.log
|
||||
|
||||
|
||||
# Build NPM
|
||||
node_modules
|
||||
custom_components/auth_oidc/static/style.css
|
||||
File diff suppressed because one or more lines are too long
@@ -1,6 +1,8 @@
|
||||
{
|
||||
"name": "OpenID Connect",
|
||||
"name": "OpenID Connect/SSO Authentication",
|
||||
"hide_default_branch": true,
|
||||
"render_readme": true,
|
||||
"homeassistant": "2025.11"
|
||||
"homeassistant": "2025.11",
|
||||
"zip_release": true,
|
||||
"filename": "hass-oidc-auth.zip"
|
||||
}
|
||||
20
scripts/build
Executable file
20
scripts/build
Executable file
@@ -0,0 +1,20 @@
|
||||
#! /bin/bash
|
||||
|
||||
# Build the plugin CSS
|
||||
npm install --frozen-lockfile
|
||||
npm run css
|
||||
|
||||
# Copy only the required files for zip
|
||||
mkdir -p tmp_build
|
||||
cp -r custom_components tmp_build/
|
||||
cp hacs.json tmp_build/
|
||||
cp LICENSE.md tmp_build/
|
||||
cp pyproject.toml tmp_build/
|
||||
cp README.md tmp_build/
|
||||
|
||||
# Create zip from the tmp_build directory
|
||||
cd tmp_build
|
||||
zip -r ../hass-oidc-auth.zip ./*
|
||||
|
||||
cd ..
|
||||
rm -rf tmp_build
|
||||
Reference in New Issue
Block a user