Skip to content

v1.16.2

v1.16.2 #857

Workflow file for this run

# This workflow will install Python dependencies, run tests and lint with a single version of Python
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions
name: Quality Checks
on:
push:
branches:
- '**'
pull_request:
# branches: [ master ]
workflow_dispatch:
jobs:
lint:
runs-on: ubuntu-20.04
strategy:
matrix:
python-version: [3.8, 3.9, '3.10', 3.11]
steps:
- uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Install Test dependencies
run: |
pip install -e .[test]
- name: Lint
run: |
scripts/lint
type_check:
runs-on: ubuntu-20.04
strategy:
matrix:
python-version: [3.8, 3.9, '3.10', 3.11]
steps:
- uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
cache: 'pip'
- name: Install Test dependencies
run: |
pip install -e .[test]
- name: Type Check
run: |
scripts/type_check
test:
runs-on: ubuntu-20.04
strategy:
matrix:
python-version: [3.8, 3.9, '3.10', 3.11]
steps:
- uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
cache: 'pip'
- name: Install Test dependencies
run: |
pip install -e .[test]
- name: Test
run: |
scripts/test
get_version:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v3
- name: Retrieve version and Changelog
id: get_version
run: |
echo icloudpd_version=$(cat pyproject.toml | grep version= | cut -d'"' -f 2) >> $GITHUB_OUTPUT
echo 'icloudpd_changelog<<EOF' >> $GITHUB_OUTPUT
scripts/extract_releasenotes CHANGELOG.md >> $GITHUB_OUTPUT
echo 'EOF' >> $GITHUB_OUTPUT
- name: Log version and Changelog
run: |
echo "icloudpd_version=${{steps.get_version.outputs.icloudpd_version}}"
echo "icloudpd_changelog=${{steps.get_version.outputs.icloudpd_changelog}}"
outputs:
icloudpd_version: ${{steps.get_version.outputs.icloudpd_version}}
icloudpd_changelog: ${{steps.get_version.outputs.icloudpd_changelog}}
build_src:
runs-on: ubuntu-20.04
needs: [get_version]
defaults:
run:
shell: bash
steps:
- uses: actions/checkout@v3
- name: Set up Python 3.11
uses: actions/setup-python@v4
with:
python-version: '3.11'
- name: Install Dev dependencies
run: |
pip install -e .[dev]
- name: Build Python Wheel
run: |
scripts/build
- name: Upload artifacts
uses: actions/upload-artifact@v3
with:
name: icloudpd-${{needs.get_version.outputs.icloudpd_version}}-artifacts
if-no-files-found: error
path: |
dist/icloud*.whl
build_linux:
runs-on: ubuntu-20.04
needs: [get_version]
defaults:
run:
shell: bash
steps:
- uses: actions/checkout@v3
- name: Set up Python 3.11
uses: actions/setup-python@v4
with:
python-version: '3.11'
- name: Install Dev dependencies
run: |
pip install -e .[dev]
- name: Build Release Executables
run: |
scripts/build_bin_linux ${{needs.get_version.outputs.icloudpd_version}} amd64
- name: Build Python Binary Wheel
run: |
scripts/build_binary_dist_linux ${{needs.get_version.outputs.icloudpd_version}}
- name: Upload artifacts
uses: actions/upload-artifact@v3
with:
name: icloudpd-${{needs.get_version.outputs.icloudpd_version}}-artifacts
if-no-files-found: error
path: |
dist/icloud*
build_macos:
runs-on: macos-11
needs: [get_version]
defaults:
run:
shell: bash
steps:
- uses: actions/checkout@v3
- name: Set up Python 3.11
uses: actions/setup-python@v4
with:
python-version: '3.11'
- name: Install Dev dependencies
run: |
pip install -e .[dev]
- name: Build Release Executables
run: |
scripts/build_bin_macos ${{needs.get_version.outputs.icloudpd_version}} amd64
- name: Build Python Binary Wheel
run: |
scripts/build_binary_dist_macos ${{needs.get_version.outputs.icloudpd_version}}
- name: Upload artifacts
uses: actions/upload-artifact@v3
with:
name: icloudpd-${{needs.get_version.outputs.icloudpd_version}}-artifacts
if-no-files-found: error
path: |
dist/icloud*
build_windows:
runs-on: windows-2019
needs: [get_version]
defaults:
run:
shell: bash
steps:
- uses: actions/checkout@v3
- name: Set up Python 3.11
uses: actions/setup-python@v4
with:
python-version: '3.11'
- name: Install Dev dependencies
run: |
pip install -e .[dev]
- name: Build Release Executables
run: |
scripts/build_bin_windows ${{needs.get_version.outputs.icloudpd_version}} amd64
- name: Build Python Binary Wheel
run: |
scripts/build_binary_dist_windows ${{needs.get_version.outputs.icloudpd_version}}
- name: Upload artifacts
uses: actions/upload-artifact@v3
with:
name: icloudpd-${{needs.get_version.outputs.icloudpd_version}}-artifacts
if-no-files-found: error
path: |
dist/icloud*
build_docker:
runs-on: ubuntu-20.04
needs: [get_version]
steps:
- uses: actions/checkout@v3
- name: Set up QEMU
uses: docker/setup-qemu-action@v2
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Builder instance name
run: echo ${{ steps.buildx.outputs.name }}
- name: Available platforms
run: echo ${{ steps.buildx.outputs.platforms }}
- name: Build Release Docker
uses: docker/build-push-action@v3
with:
context: .
file: ./Dockerfile
platforms: linux/amd64
push: false
tags: |
icloudpd/icloudpd:latest
icloudpd/icloudpd:${{needs.get_version.outputs.icloudpd_version}}
build_npm:
runs-on: ubuntu-20.04
needs: [get_version,build_src,build_linux,build_macos,build_windows]
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Setup Node
uses: actions/setup-node@v3
with:
node-version: '16.x'
registry-url: 'https://registry.npmjs.org'
- name: Download artifacts
uses: actions/download-artifact@v3
with:
name: icloudpd-${{needs.get_version.outputs.icloudpd_version}}-artifacts
path: |
dist
- name: Build Package
run: |
scripts/build_npm ${{needs.get_version.outputs.icloudpd_version}}
- name: Publish NPM (Dry-run)
run: |
npm publish dist/npm/@icloudpd/linux-x64 --access public --dry-run=true
npm publish dist/npm/@icloudpd/win32-x64 --access public --dry-run=true
npm publish dist/npm/@icloudpd/darwin-x64 --access public --dry-run=true
npm publish dist/npm/@icloudpd/darwin-arm64 --access public --dry-run=true
npm publish dist/npm/icloudpd --access public --dry-run=true
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}