Skip to content

Commit

Permalink
GH-705: Release Source Distribution for underthsea_core (#708)
Browse files Browse the repository at this point in the history
  • Loading branch information
rain1024 authored Aug 19, 2023
1 parent b04d521 commit 419346e
Show file tree
Hide file tree
Showing 4 changed files with 43 additions and 8 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build-core-docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ env:

jobs:
docker:
if: "contains(github.event.head_commit.message, 'Build docker')"
if: contains(github.event.head_commit.message, 'Build docker')
runs-on: ubuntu-latest
steps:
- name: Checkout
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/build-core.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
- name: Install dependencies
run: |
python -m pip install --upgrade pip
curl -sSL https://raw.githubusercontent.com/python-poetry/poetry/master/get-poetry.py | python
curl -sSL https://install.python-poetry.org | python -
- name: Add poetry to path
run: echo "${HOME}/.poetry/bin" >> $GITHUB_PATH
- name: Install package deps
Expand Down
45 changes: 40 additions & 5 deletions .github/workflows/release-pypi-core.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,45 @@ on:
push:
branches: [ core ]

env:
PYPI_TOKEN: ${{ secrets.PYPI_UNDERTHESEA_CORE_API_TOKEN }}

jobs:
source_distribute:
name: "Source Distribute"
if: contains(github.event.head_commit.message, 'Publish Underthesea Core')
runs-on: ubuntu-latest
container:
image: ghcr.io/undertheseanlp/underthesea/build_rust:1.0.0
env:
HOME: /root
PYTHON: python${{ matrix.python-version }}
strategy:
fail-fast: false
matrix:
python-version: ["3.10"]
steps:
- uses: actions/checkout@v1
- name: Create environment and install package dependencies
working-directory: ./extensions/underthesea_core
env:
LC_ALL: en_US.UTF-8 # Known issue: https://github.com/python-poetry/poetry/issues/221#issuecomment-723652470
run: |
cargo --version
$PYTHON -m poetry --version
$PYTHON -m poetry install
$PYTHON -m poetry show
- name: Build and publish
working-directory: ./extensions/underthesea_core
env:
MATURIN_PASSWORD: ${{ secrets.PYPI_UNDERTHESEA_CORE_API_TOKEN }}
run: |
$PYTHON -m poetry run maturin sdist
pip install twine
twine upload ./target/wheels/* -u __token__ -p "$PYPI_TOKEN"
linux:
name: "Linux"
if: "contains(github.event.head_commit.message, 'Publish Underthesea Core')"
if: contains(github.event.head_commit.message, 'Publish Underthesea Core')
runs-on: ubuntu-latest
container:
image: ghcr.io/undertheseanlp/underthesea/build_rust:1.0.0
Expand Down Expand Up @@ -37,7 +72,7 @@ jobs:
$PYTHON -m poetry run maturin publish --username __token__ --no-sdist --interpreter python${{ matrix.python-version }}
windows:
name: "Windows"
if: "contains(github.event.head_commit.message, 'Publish Underthesea Core')"
if: contains(github.event.head_commit.message, 'Publish Underthesea Core')
runs-on: windows-latest
strategy:
fail-fast: false
Expand Down Expand Up @@ -72,7 +107,7 @@ jobs:
poetry run maturin publish --username __token__ --no-sdist --interpreter python
macos-x86:
name: "MacOS x86"
if: "contains(github.event.head_commit.message, 'Publish Underthesea Core')"
if: contains(github.event.head_commit.message, 'Publish Underthesea Core')
runs-on: macos-latest
strategy:
fail-fast: false
Expand Down Expand Up @@ -109,8 +144,8 @@ jobs:
poetry run maturin publish --username __token__ --no-sdist --interpreter python${{ matrix.python-version }}
macos-arm:
name: "MacOS ARM"
if: "contains(github.event.head_commit.message, 'Publish Underthesea Core')"
runs-on: macos-arm64
if: contains(github.event.head_commit.message, 'Publish Underthesea Core')
runs-on: self-hosted
strategy:
fail-fast: false
matrix:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release-pypi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ on:

jobs:
build_and_package_pypi:
if: "contains(github.event.head_commit.message, 'Release')"
if: contains(github.event.head_commit.message, 'Release')
name: Build and package Pypi
runs-on: ubuntu-latest
steps:
Expand Down

0 comments on commit 419346e

Please sign in to comment.