0.6.0 #38
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Release | |
| on: | |
| release: | |
| types: [created] | |
| jobs: | |
| get-release: | |
| runs-on: ubuntu-24.04-arm | |
| steps: | |
| - name: Get Release | |
| id: get_release | |
| uses: bruceadams/get-release@v1.3.2 | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Dump upload url to file | |
| run: echo '${{ steps.get_release.outputs.upload_url }}' > upload_url | |
| - name: Upload upload_url | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: upload_url | |
| path: upload_url | |
| build: | |
| needs: get-release | |
| strategy: | |
| matrix: | |
| platform: [ | |
| 'linux-arm64', | |
| # 'linux-x64', | |
| ] | |
| pair: [ | |
| # 'python:3.7', | |
| # 'python:3.9', | |
| 'python:3.11', | |
| 'python:3.13', | |
| ] | |
| include: | |
| # - platform: 'linux-arm' | |
| # host-os: 'ubuntu-latest' | |
| - platform: 'linux-arm64' | |
| host-os: 'ubuntu-24.04-arm' | |
| # - platform: 'linux-x64' | |
| # host-os: 'ubuntu-latest' | |
| # - pair: 'python:3.7' | |
| # language: 'python' | |
| # version: '3.7' | |
| # - pair: 'python:3.9' | |
| # language: 'python' | |
| # version: '3.9' | |
| - pair: 'python:3.11' | |
| language: 'python' | |
| version: '3.11' | |
| - pair: 'python:3.13' | |
| language: 'python' | |
| version: '3.13' | |
| runs-on: ${{ matrix.host-os }} | |
| steps: | |
| - name: Download upload_url | |
| uses: actions/download-artifact@v4 | |
| with: | |
| name: upload_url | |
| path: upload_url | |
| - name: Set upload_url | |
| run: echo "UPLOAD_URL=$(cat upload_url/upload_url)" >> $GITHUB_ENV | |
| - name: Set release version | |
| run: echo "RELEASE_VERSION=${GITHUB_REF:10}" >> $GITHUB_ENV | |
| - uses: actions/checkout@v3 | |
| - name: Use Python ${{ matrix.version }} | |
| uses: actions/setup-python@v4 | |
| with: | |
| python-version: ${{ matrix.version }} | |
| # - name: Make build script executable | |
| # run: chmod +x ./build.sh | |
| - name: Make packaging script executable | |
| run: | | |
| chmod +x ./package.sh | |
| - name: Build addon | |
| run: | | |
| ./package.sh "${{ matrix.platform }}" "${{ matrix.language }}" "${{ matrix.version }}" | |
| shell: bash | |
| - name: Upload Release Asset tgz | |
| uses: shogo82148/actions-upload-release-asset@v1 | |
| with: | |
| #upload_url: ${{ github.event.release.upload_url }} | |
| upload_url: ${{ env.UPLOAD_URL }} | |
| asset_path: bluetoothpairing-${{ env.RELEASE_VERSION }}-${{ matrix.platform }}-v${{ matrix.version }}.tgz | |
| overwrite: true | |
| - name: Upload Release Asset shasum | |
| uses: shogo82148/actions-upload-release-asset@v1 | |
| with: | |
| #upload_url: ${{ github.event.release.upload_url }} | |
| upload_url: ${{ env.UPLOAD_URL }} | |
| asset_path: bluetoothpairing-${{ env.RELEASE_VERSION }}-${{ matrix.platform }}-v${{ matrix.version }}.tgz.sha256sum | |
| overwrite: true | |
| # | |
| # ATTEMPT TO ALSO BUILD 32 BIT VERSION | |
| # | |
| get-release_old: | |
| runs-on: ubuntu-24.04 | |
| steps: | |
| - name: Get Release | |
| id: get_release | |
| uses: bruceadams/get-release@v1.3.2 | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Dump upload url to file | |
| run: echo '${{ steps.get_release.outputs.upload_url }}' > upload_url_old | |
| - name: Upload upload_url_old | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: upload_url_old | |
| path: upload_url_old | |
| build_job_old: | |
| needs: get-release | |
| # The host should always be linux | |
| runs-on: ubuntu-24.04 | |
| name: Build on ${{ matrix.distro }} ${{ matrix.arch }} | |
| # Run steps on a matrix of arch/distro combinations | |
| strategy: | |
| matrix: | |
| arch: [armv7] | |
| version: ['3.11'] | |
| include: | |
| - distro: bookworm | |
| - arch: armv7 | |
| platform: linux-arm | |
| steps: | |
| - name: Download upload_url_old | |
| uses: actions/download-artifact@v4 | |
| with: | |
| name: upload_url_old | |
| path: upload_url_old | |
| - name: Display upload_url folder contents | |
| run: ls -lah upload_url_old | |
| - name: Set upload_url | |
| run: echo "UPLOAD_URL_OLD=$(cat upload_url_old/upload_url_old)" >> $GITHUB_ENV | |
| - name: Set release version | |
| run: echo "RELEASE_VERSION=${GITHUB_REF:10}" >> $GITHUB_ENV | |
| - uses: actions/checkout@v4 | |
| with: | |
| path: './build' | |
| #- name: Make packaging script executable | |
| # run: | | |
| # chmod +x ./package.sh | |
| - uses: uraimo/run-on-arch-action@v3 | |
| name: Build artifact | |
| id: build_it | |
| with: | |
| arch: ${{ matrix.arch }} | |
| distro: ${{ matrix.distro }} | |
| #version: ${{ matrix.version }} | |
| # Not required, but speeds up builds | |
| # githubToken: ${{ github.token }} | |
| # Create a build directory | |
| setup: | | |
| echo "github workspace: $GITHUB_WORKSPACE/" | |
| pwd | |
| mkdir -p "${PWD}/build" | |
| #echo "build folder created?" | |
| echo "PWD: ${PWD}" | |
| ls | |
| # Mount the build directory as /build in the container | |
| dockerRunArgs: | | |
| --volume "${PWD}/build:/build" | |
| # Pass some environment variables to the container | |
| env: | # YAML, but pipe character is necessary | |
| artifact_name: git-${{ matrix.distro }}_${{ matrix.arch }} | |
| # The shell to run commands within the container | |
| shell: /bin/bash | |
| # Install some dependencies in the container. This speeds up builds if | |
| # you are also using githubToken. Any dependencies installed here will | |
| # be part of the container image that gets cached, so subsequent | |
| # builds don't have to re-install them. The image layer is cached | |
| # publicly in your project's package repository, so it is vital that | |
| # no secrets are present in the container state or logs. | |
| install: | | |
| case "${{ matrix.distro }}" in | |
| ubuntu*|jessie|stretch|buster|bullseye|bookworm|trixie) | |
| apt-get update -q -y | |
| apt-get install -q -y git | |
| apt-get install -q -y "python${{ matrix.version }}" python3-pip | |
| #apt-get install -q -y libjpeg-dev zlib1g-dev libpng-dev | |
| alias python="python${{ matrix.version }}" | |
| alias python3="python${{ matrix.version }}" | |
| echo "___ PWD: $PWD ___" | |
| echo "=== matrix.version: ${{ matrix.version }}" | |
| ls -al "${PWD}" | |
| echo "___ package.sh? ___" | |
| find / -name package.sh | |
| #echo "___ build folder? ___" | |
| #find / -name build | |
| ;; | |
| fedora*) | |
| dnf -y update | |
| dnf -y install git which | |
| ls -al "${PWD}" | |
| ;; | |
| alpine*) | |
| apk update | |
| apk add git | |
| ls -al "${PWD}" | |
| #python3 --version | |
| ;; | |
| esac | |
| # Produce a binary artifact and place it in the mounted volume | |
| #run: | | |
| # cp $(which git) "/build/${artifact_name}" | |
| # echo "Produced artifact at /build/${artifact_name}" | |
| run: | | |
| cd build | |
| ls | |
| echo "Python version from workflow matrix: ${{ matrix.version }}" | |
| chmod +x package.sh | |
| export PYTHON_VERSION="${{ matrix.version }}" | |
| echo "PYTHON_VERSION: $PYTHON_VERSION" | |
| ADDON_ARCH="${{ matrix.platform }}" ./package.sh "${{ matrix.platform }}" "${{ matrix.language }}" "${{ matrix.version }}" | |
| ls -lh | |
| cp voco* .. | |
| #- name: Show the artifact | |
| # Items placed in /build in the container will be in | |
| # ${PWD}/build on the host. | |
| # run: | | |
| # ls -al "${PWD}" | |
| #- name: List after container | |
| # run: | | |
| # ls -lh | |
| # shell: bash | |
| - name: Upload Release Asset tgz | |
| uses: shogo82148/actions-upload-release-asset@v1 | |
| with: | |
| #upload_url: ${{ github.event.release.upload_url }} | |
| upload_url: ${{ env.UPLOAD_URL_OLD }} | |
| asset_path: bluetoothpairing-${{ env.RELEASE_VERSION }}-${{ matrix.platform }}-v${{ matrix.version }}.tgz | |
| overwrite: true | |
| - name: Upload Release Asset shasum | |
| uses: shogo82148/actions-upload-release-asset@v1 | |
| with: | |
| #upload_url: ${{ github.event.release.upload_url }} | |
| upload_url: ${{ env.UPLOAD_URL_OLD }} | |
| asset_path: bluetoothpairing-${{ env.RELEASE_VERSION }}-${{ matrix.platform }}-v${{ matrix.version }}.tgz.sha256sum | |
| overwrite: true |