Build & release wheels #540
This file contains 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: Build & release wheels | |
on: | |
push: | |
branches: | |
- main | |
schedule: | |
- cron: '53 21 * * *' # Daily at 21:53 UTC | |
workflow_dispatch: | |
jobs: | |
build: | |
strategy: | |
matrix: | |
runner: | |
- name: X64 | |
runs-on: ubuntu-latest | |
- name: ARM64 | |
runs-on: [self-hosted, data-platform, ubuntu, ARM64, 4cpu16ram] | |
name: Build wheels | ${{ matrix.runner.name }} | |
runs-on: ${{ matrix.runner.runs-on }} | |
timeout-minutes: 180 | |
steps: | |
- name: (Data Platform hosted) Update git | |
if: ${{ matrix.runner.name == 'ARM64' }} | |
run: | | |
sudo add-apt-repository ppa:git-core/ppa | |
sudo apt-get update | |
sudo apt-get install git -y | |
- name: Install pyenv | |
run: | | |
sudo apt-get update | |
sudo apt-get install build-essential libssl-dev zlib1g-dev libbz2-dev libreadline-dev libsqlite3-dev curl libncursesw5-dev xz-utils tk-dev libxml2-dev libxmlsec1-dev libffi-dev liblzma-dev -y | |
curl https://pyenv.run | bash | |
- name: Install rust | |
# Need new version of Rust compiler to build rpds-py>=0.19.0 | |
run: | | |
sudo snap install rustup --classic | |
echo "/snap/bin" >> "$GITHUB_PATH" | |
rustup default stable | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Set up environment | |
run: | | |
pipx install poetry | |
pipx install tox | |
- name: Install CLI | |
run: pipx install ./cli/ | |
- name: Build wheels from source | |
run: build charms.json | |
- name: Upload wheels | |
uses: actions/upload-artifact@v4 | |
with: | |
name: wheels-${{ matrix.runner.name }} | |
path: ~/charmcraftcache-hub-ci/release/ | |
if-no-files-found: error | |
release: | |
name: Release wheels | |
needs: | |
- build | |
runs-on: ubuntu-latest | |
timeout-minutes: 60 | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Install CLI | |
run: pipx install ./cli/ | |
- name: Create directory | |
run: mkdir ~/release/ | |
- name: Download wheels | |
uses: actions/download-artifact@v4 | |
with: | |
path: ~/release/ | |
pattern: wheels-* | |
merge-multiple: true | |
- name: Create GitHub release | |
run: create-release | |
env: | |
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
permissions: | |
contents: write # Needed to create release |