Skip to content

[Release] 🌈 v1.1.5 #22

[Release] 🌈 v1.1.5

[Release] 🌈 v1.1.5 #22

Workflow file for this run

name: Build & Release
on:
push:
jobs:
build_windows:
name: Build Windows Python Whell Package
runs-on: windows-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Set up Go
uses: actions/setup-go@v4
with:
go-version: 'stable'
check-latest: true
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: '3.11'
- name: Set up Python Package
run: pip install wheel setuptools
- name: Build
run: |
go build -ldflags="-s -w" -trimpath -buildmode=c-shared -o ms_auth/ms_auth.dll ./ms_auth/ && python3 setup.py bdist_wheel -p win_amd64
- uses: actions/upload-artifact@v3
with:
name: ms_auth-py3-win_amd64
path: dist/ms_auth-*-win_amd64.whl
build_macos:
name: Build macOS Python Whell Package
runs-on: macos-14
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Set up Go
uses: actions/setup-go@v4
with:
go-version: 'stable'
check-latest: true
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: '3.11'
- name: Set up Python Package
run: pip install wheel setuptools
- name: Build
run: |
CGO_ENABLED=1 GOOS=darwin GOARCH=amd64 go build -ldflags="-s -w" -trimpath -buildmode=c-shared -o ms_auth/ms_auth.so ./ms_auth/ && python3 setup.py bdist_wheel -p macosx_x86_64 && \
CGO_ENABLED=1 GOOS=darwin GOARCH=arm64 go build -ldflags="-s -w" -trimpath -buildmode=c-shared -o ms_auth/ms_auth.so ./ms_auth/ && python3 setup.py bdist_wheel -p macosx_11_0_arm64
- uses: actions/upload-artifact@v3
with:
name: ms_auth-py3-macosx_x86_64
path: dist/ms_auth-*-macosx_x86_64.whl
- uses: actions/upload-artifact@v3
with:
name: ms_auth-py3-macosx_arm64
path: dist/ms_auth-*-macosx_11_0_arm64.whl
build_linux:
name: Build Linux Python Whell Package
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Set up Go
uses: actions/setup-go@v4
with:
go-version: 'stable'
check-latest: true
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: '3.11'
- name: Set up CGo
run: |
sudo apt-get update && sudo apt-get install build-essential gcc-aarch64-linux-gnu
- name: Set up Python Package
run: |
pip install wheel setuptools
- name: Build
run: |
CGO_ENABLED=1 GOOS=linux GOARCH=amd64 go build -ldflags="-s -w" -trimpath -buildmode=c-shared -o ms_auth/ms_auth.so ./ms_auth/ && python3 setup.py bdist_wheel -p manylinux_x86_64 && \
CGO_ENABLED=1 CC=aarch64-linux-gnu-gcc GOOS=linux GOARCH=arm64 go build -ldflags="-s -w" -trimpath -buildmode=c-shared -o ms_auth/ms_auth.so ./ms_auth/ && python3 setup.py bdist_wheel -p manylinux_aarch64
- uses: actions/upload-artifact@v3
with:
name: ms_auth-py3-linux_x86_64
path: dist/ms_auth-*-manylinux_x86_64.whl
- uses: actions/upload-artifact@v3
with:
name: ms_auth-py3-linux_aarch64
path: dist/ms_auth-*-manylinux_aarch64.whl
release:
name: Release
needs: [build_windows, build_macos, build_linux]
runs-on: ubuntu-latest
if: ${{ startsWith(github.ref, 'refs/tags/v') }}
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.11'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install twine
- name: Download Windows amd64 artifact
uses: actions/download-artifact@v3
with:
name: ms_auth-py3-win_amd64
path: dist
- name: Download macOS amd64 artifact
uses: actions/download-artifact@v3
with:
name: ms_auth-py3-macosx_x86_64
path: dist
- name: Download macOS arm64 artifact
uses: actions/download-artifact@v3
with:
name: ms_auth-py3-macosx_arm64
path: dist
- name: Download Linux amd64 artifact
uses: actions/download-artifact@v3
with:
name: ms_auth-py3-linux_x86_64
path: dist
- name: Download Linux arm64 artifact
uses: actions/download-artifact@v3
with:
name: ms_auth-py3-linux_aarch64
path: dist
- name: Publish to PyPI
run: |
twine upload --skip-existing dist/*
env:
TWINE_USERNAME: __token__
TWINE_PASSWORD: ${{ secrets.PYPI_API_TOKEN }}
- name: Create Release and Upload Release Asset
uses: softprops/action-gh-release@v1
with:
files: |
dist/*.whl