mirror of
https://github.com/home-assistant/frontend.git
synced 2025-07-25 18:26:35 +00:00
Move release builds from Azure to Github (#8128)
* Move release builds from Azure to Github * Fix syntax issue (YAML is hard)
This commit is contained in:
parent
d02a2e8c2e
commit
2a14a3a4dc
77
.github/workflows/release.yaml
vendored
Normal file
77
.github/workflows/release.yaml
vendored
Normal file
@ -0,0 +1,77 @@
|
|||||||
|
name: Release
|
||||||
|
|
||||||
|
on:
|
||||||
|
release:
|
||||||
|
types:
|
||||||
|
- published
|
||||||
|
|
||||||
|
env:
|
||||||
|
WHEELS_TAG: 3.7-alpine3.11
|
||||||
|
PYTHON_VERSION: 3.7
|
||||||
|
NODE_VERSION: 12.1
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
release:
|
||||||
|
name: Release
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- name: Checkout the repository
|
||||||
|
uses: actions/checkout@v2
|
||||||
|
|
||||||
|
- 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 }}
|
||||||
|
|
||||||
|
- name: Build and release package
|
||||||
|
run: |
|
||||||
|
export TWINE_USERNAME="__token__"
|
||||||
|
export TWINE_PASSWORD="${{ secrets.TWINE_TOKEN }}"
|
||||||
|
|
||||||
|
script/release
|
||||||
|
|
||||||
|
wheels-init:
|
||||||
|
name: Init wheels build
|
||||||
|
needs: release
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- name: Generate requirements.txt
|
||||||
|
run: |
|
||||||
|
# Sleep to give pypi time to populate the new version across mirrors
|
||||||
|
sleep 240
|
||||||
|
version=$(echo "${{ github.ref }}" | awk -F"/" '{print $NF}' )
|
||||||
|
echo "home-assistant-frontend==$version" > ./requirements.txt
|
||||||
|
|
||||||
|
- name: Upload requirements.txt
|
||||||
|
uses: actions/upload-artifact@v2
|
||||||
|
with:
|
||||||
|
name: requirements
|
||||||
|
path: ./requirements.txt
|
||||||
|
|
||||||
|
build-wheels:
|
||||||
|
name: Build wheels for ${{ matrix.arch }}
|
||||||
|
needs: wheels-init
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
strategy:
|
||||||
|
matrix:
|
||||||
|
arch: ["aarch64", "armhf", "armv7", "amd64", "i386"]
|
||||||
|
steps:
|
||||||
|
- name: Download requirements.txt
|
||||||
|
uses: actions/download-artifact@v2
|
||||||
|
with:
|
||||||
|
name: requirements
|
||||||
|
|
||||||
|
- name: Build wheels
|
||||||
|
uses: home-assistant/wheels@master
|
||||||
|
with:
|
||||||
|
tag: ${{ env.WHEELS_TAG }}
|
||||||
|
arch: ${{ matrix.arch }}
|
||||||
|
wheels-host: ${{ secrets.WHEELS_HOST }}
|
||||||
|
wheels-key: ${{ secrets.WHEELS_KEY }}
|
||||||
|
wheels-user: wheels
|
||||||
|
requirements: "requirements.txt"
|
@ -1,59 +0,0 @@
|
|||||||
# https://dev.azure.com/home-assistant
|
|
||||||
|
|
||||||
trigger:
|
|
||||||
batch: true
|
|
||||||
tags:
|
|
||||||
include:
|
|
||||||
- "*"
|
|
||||||
pr: none
|
|
||||||
variables:
|
|
||||||
- name: versionWheels
|
|
||||||
value: '1.10.1-3.7-alpine3.11'
|
|
||||||
- name: versionNode
|
|
||||||
value: '12.1'
|
|
||||||
- group: twine
|
|
||||||
resources:
|
|
||||||
repositories:
|
|
||||||
- repository: azure
|
|
||||||
type: github
|
|
||||||
name: 'home-assistant/ci-azure'
|
|
||||||
endpoint: 'home-assistant'
|
|
||||||
|
|
||||||
|
|
||||||
stages:
|
|
||||||
- stage: "Validate"
|
|
||||||
jobs:
|
|
||||||
- template: templates/azp-job-version.yaml@azure
|
|
||||||
|
|
||||||
- stage: "Build"
|
|
||||||
jobs:
|
|
||||||
- job: "ReleasePython"
|
|
||||||
pool:
|
|
||||||
vmImage: "ubuntu-latest"
|
|
||||||
steps:
|
|
||||||
- task: UsePythonVersion@0
|
|
||||||
displayName: "Use Python 3.7"
|
|
||||||
inputs:
|
|
||||||
versionSpec: "3.7"
|
|
||||||
- task: NodeTool@0
|
|
||||||
displayName: "Use Node $(versionNode)"
|
|
||||||
inputs:
|
|
||||||
versionSpec: "$(versionNode)"
|
|
||||||
- script: pip install twine wheel
|
|
||||||
displayName: "Install tools"
|
|
||||||
- script: |
|
|
||||||
export TWINE_USERNAME="$(twineUser)"
|
|
||||||
export TWINE_PASSWORD="$(twinePassword)"
|
|
||||||
|
|
||||||
script/release
|
|
||||||
displayName: "Build and release package"
|
|
||||||
- stage: "Wheels"
|
|
||||||
jobs:
|
|
||||||
- template: templates/azp-job-wheels.yaml@azure
|
|
||||||
parameters:
|
|
||||||
builderVersion: '$(versionWheels)'
|
|
||||||
wheelsRequirement: 'requirement.txt'
|
|
||||||
preBuild:
|
|
||||||
- script: |
|
|
||||||
sleep 240
|
|
||||||
echo "home-assistant-frontend==$(Build.SourceBranchName)" > requirement.txt
|
|
Loading…
x
Reference in New Issue
Block a user