-
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
148 additions
and
11 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,144 @@ | ||
name: Build and Publish to Testing PyPI on Push | ||
on: | ||
push: | ||
branches: | ||
- 'master' | ||
- 'main' | ||
|
||
jobs: | ||
release: | ||
name: Create Release | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v3 | ||
|
||
- name: Create Release | ||
uses: actions/create-release@v1 | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
with: | ||
tag_name: ${{ github.ref }} | ||
release_name: Release ${{ github.ref }} | ||
body: | | ||
Changes in this Release | ||
draft: false | ||
prerelease: false | ||
|
||
arm_builds: | ||
needs: release | ||
runs-on: ${{matrix.os}} | ||
strategy: | ||
matrix: | ||
os: ["buster"] | ||
platform: ["armv6", "armv7", "aarch64"] | ||
python-version: ["3.8", "3.9", "3.10"] | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: uraimo/[email protected] | ||
name: Setup Python ${{ matrix.python-version }} on ${{ matrix.platform }} | ||
with: | ||
arch: ${{ matrix.platform }} | ||
distro: ${{ matrix.os }} | ||
githubToken: ${{ github.token }} | ||
shell: /bin/bash | ||
install: | | ||
apt-get update -q -y | ||
apt-get install -y make build-essential libssl-dev zlib1g-dev libbz2-dev \ | ||
libreadline-dev libsqlite3-dev wget curl llvm libncurses5-dev libncursesw5-dev \ | ||
xz-utils tk-dev libffi-dev liblzma-dev | ||
curl -L https://raw.githubusercontent.com/pyenv/pyenv-installer/master/bin/pyenv-installer | bash | ||
cat << EOT >> ~/.bashrc | ||
export PYENV_ROOT="$HOME/.pyenv" | ||
export PATH="$PYENV_ROOT/bin:$PATH" | ||
if command -v pyenv 1>/dev/null 2>&1; then | ||
eval "$(pyenv init -)" | ||
fi | ||
EOT | ||
source ~/.bashrc | ||
pyenv install ${{ matrix.python-version }} | ||
pyenv global ${{ matrix.python-version }} | ||
- name: Install Dependencies | ||
run: | | ||
python -m pip install flit | ||
python -m flit install | ||
- name: Build and Publish | ||
run: | | ||
python -m flit build | ||
macos_builds: | ||
needs: release | ||
runs-on: ${{matrix.os}} | ||
strategy: | ||
matrix: | ||
os: ["macos-latest"] | ||
platform: ["x64"] | ||
python-version: ["3.8", "3.9", "3.10"] | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: Setup Python ${{ matrix.python-version }} | ||
uses: actions/setup-python@v3 | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
architecture: ${{ matrix.platform }} | ||
|
||
- name: Install Dependencies | ||
run: | | ||
python -m pip install flit | ||
python -m flit install | ||
- name: Build and Publish | ||
run: | | ||
python -m flit build | ||
linux_builds: | ||
needs: release | ||
runs-on: ${{matrix.os}} | ||
strategy: | ||
matrix: | ||
os: ["ubuntu-latest"] | ||
platform: ["x64"] | ||
python-version: ["3.8", "3.9", "3.10"] | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: Setup Python ${{ matrix.python-version }} | ||
uses: actions/setup-python@v3 | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
architecture: ${{ matrix.platform }} | ||
|
||
- name: Install Dependencies | ||
run: | | ||
python -m pip install flit | ||
python -m flit install | ||
- name: Build and Publish | ||
run: | | ||
python -m flit build | ||
deploy: | ||
needs: [linux_builds, macos_builds, arm_builds] | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: Setup Python 3.10 | ||
uses: actions/setup-python@v3 | ||
with: | ||
python-version: "3.10" | ||
|
||
- name: Install Dependencies | ||
run: | | ||
python -m pip install flit | ||
python -m flit install | ||
- name: Build and Publish | ||
run: | | ||
python -m flit build | ||
- name: Publish distribution to TestPyPI | ||
uses: pypa/gh-action-pypi-publish@master | ||
with: | ||
user: __token__ | ||
password: ${{ secrets.testpypi_token }} | ||
repository_url: https://test.pypi.org/legacy/ |
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