diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml new file mode 100644 index 0000000000..b586bbdde6 --- /dev/null +++ b/.github/workflows/release.yaml @@ -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" diff --git a/azure-pipelines-release.yml b/azure-pipelines-release.yml deleted file mode 100644 index e357b7fa99..0000000000 --- a/azure-pipelines-release.yml +++ /dev/null @@ -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