added workflow to build HA Frontend SDIST
Signed-off-by: Anton Fischl <github@fischl-online.de>
This commit is contained in:
parent
565d1c05a7
commit
276252f328
44
.github/workflows/check-ha-frontend-release.yml
vendored
Normal file
44
.github/workflows/check-ha-frontend-release.yml
vendored
Normal file
@ -0,0 +1,44 @@
|
|||||||
|
name: 'HA Frontend - check new relase'
|
||||||
|
|
||||||
|
on:
|
||||||
|
workflow_dispatch:
|
||||||
|
schedule:
|
||||||
|
- cron: '17 * * * *' # @Hourly
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
check-new-release:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
outputs:
|
||||||
|
skip: ${{ steps.check-version.outputs.cache-hit }}
|
||||||
|
steps:
|
||||||
|
- name: Get latest version
|
||||||
|
id: latest-version
|
||||||
|
run: |
|
||||||
|
git ls-remote --tags --sort="version:refname" https://github.com/home-assistant/frontend.git|grep -E "refs/tags/20[2-9][0-9]{5}\.[0-9]$"|tail -1|awk -F / '{print $3}' > latest-release
|
||||||
|
cat latest-release
|
||||||
|
echo "::set-output name=latest-version::$(cat latest-release)"
|
||||||
|
|
||||||
|
- name: Check if we allready did this version
|
||||||
|
id: check-version
|
||||||
|
uses: actions/cache@v2
|
||||||
|
with:
|
||||||
|
key: ${{ steps.latest-version.outputs.latest-version }}
|
||||||
|
path: latest-release
|
||||||
|
|
||||||
|
make-ha-frontend-sdist:
|
||||||
|
needs: check-new-release
|
||||||
|
if: ${{ !needs.check-new-release.outputs.skip }}
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- uses: actions/github-script@v6
|
||||||
|
with:
|
||||||
|
github-token: ${{ secrets.PAT_TOKEN }}
|
||||||
|
script: |
|
||||||
|
await github.rest.actions.createWorkflowDispatch({
|
||||||
|
owner: 'onkelbeh',
|
||||||
|
repo: 'HomeAssistantRepository',
|
||||||
|
workflow_id: 'make-ha-frontend-sdist.yml',
|
||||||
|
ref: 'main'
|
||||||
|
})
|
||||||
|
|
||||||
|
|
||||||
79
.github/workflows/make-ha-frontend-sdist.yml
vendored
Normal file
79
.github/workflows/make-ha-frontend-sdist.yml
vendored
Normal file
@ -0,0 +1,79 @@
|
|||||||
|
name: 'HA Frontend - make SDIST'
|
||||||
|
|
||||||
|
on:
|
||||||
|
workflow_dispatch:
|
||||||
|
|
||||||
|
env:
|
||||||
|
PYTHON_VERSION: 3.8
|
||||||
|
NODE_VERSION: 14
|
||||||
|
NODE_OPTIONS: --max_old_space_size=6144
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
make-sdist:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- name: get-version
|
||||||
|
id: get-version
|
||||||
|
run: |
|
||||||
|
git ls-remote --tags --sort='version:refname' https://github.com/home-assistant/frontend.git|grep -E 'refs/tags/20[2-9][0-9]{5}\.[0-9]$'|tail -1|awk -F / '{print $3}'
|
||||||
|
echo "::set-output name=version::$(git ls-remote --tags --sort='version:refname' https://github.com/home-assistant/frontend.git|grep -E 'refs/tags/20[2-9][0-9]{5}\.[0-9]$'|tail -1|awk -F / '{print $3}')"
|
||||||
|
|
||||||
|
- name: Checkout frontend repository
|
||||||
|
uses: actions/checkout@v3
|
||||||
|
with:
|
||||||
|
repository: home-assistant/frontend
|
||||||
|
ref: ${{ steps.get-version.outputs.version }}
|
||||||
|
|
||||||
|
- name: Set up Python ${{ env.PYTHON_VERSION }}
|
||||||
|
uses: actions/setup-python@v2
|
||||||
|
with:
|
||||||
|
python-version: ${{ env.PYTHON_VERSION }}
|
||||||
|
|
||||||
|
- name: Set up Node ${{ env.NODE_VERSION }}
|
||||||
|
uses: actions/setup-node@v2
|
||||||
|
with:
|
||||||
|
node-version: ${{ env.NODE_VERSION }}
|
||||||
|
cache: yarn
|
||||||
|
|
||||||
|
- name: Install dependencies
|
||||||
|
run: yarn install
|
||||||
|
|
||||||
|
- name: Download Translations
|
||||||
|
run: ./script/translations_download
|
||||||
|
env:
|
||||||
|
LOKALISE_TOKEN: ${{ secrets.LOKALISE_TOKEN }}
|
||||||
|
|
||||||
|
- name: Build and release package
|
||||||
|
run: |
|
||||||
|
python3 -m pip install build
|
||||||
|
#export TWINE_USERNAME="__token__"
|
||||||
|
#export TWINE_PASSWORD="${{ secrets.TWINE_TOKEN }}"
|
||||||
|
#script/release
|
||||||
|
script/build_frontend
|
||||||
|
rm -rf dist home_assistant_frontend.egg-info
|
||||||
|
python3 -m build
|
||||||
|
|
||||||
|
- name: Upload build artifacts
|
||||||
|
uses: actions/upload-artifact@v2
|
||||||
|
with:
|
||||||
|
name: ha-frontend-${{ steps.get-version.outputs.version }}
|
||||||
|
path: ./dist/*.tar.gz
|
||||||
|
|
||||||
|
- name: Upload SDIST to nextcloud
|
||||||
|
run: |
|
||||||
|
sudo add-apt-repository ppa:nextcloud-devs/client
|
||||||
|
sudo apt update
|
||||||
|
sudo apt install nextcloud-client
|
||||||
|
rm dist/*.whl
|
||||||
|
sudo nextcloudcmd -s -u ${{ secrets.NEXTCLOUD_USER }} -p ${{ secrets.NEXTCLOUD_PASSWORD }} --non-interactive dist/ ${{ secrets.NEXTCLOUD_URL }}
|
||||||
|
|
||||||
|
- name: Create Issue
|
||||||
|
uses: actions-ecosystem/action-create-issue@v1
|
||||||
|
with:
|
||||||
|
github_token: ${{ secrets.PAT_TOKEN }}
|
||||||
|
title: new HA Frontend ${{ steps.get-version.outputs.version }}
|
||||||
|
body: |
|
||||||
|
SDIST uploaded to nextcloud
|
||||||
|
|
||||||
|
|
||||||
Loading…
x
Reference in New Issue
Block a user