Bump actions/download-artifact from 3 to 4.1.7 in /.github/workflows #32
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 | |
on: | |
push: | |
branches: [ "master" ] | |
tags: | |
- "release-*" | |
pull_request: | |
branches: [ "master" ] | |
jobs: | |
build: | |
name: Build binaries on ${{ matrix.os }} - ${{ matrix.arch }} | |
runs-on: ${{ matrix.os }} | |
strategy: | |
matrix: | |
include: | |
- { name: windows, os: windows-latest, arch: x64} | |
- { name: windows, os: windows-latest, arch: x86} | |
- { name: macos, os: macos-latest, arch: x86_64} | |
- { name: macos, os: macos-latest, arch: arm64} | |
- { name: linux, os: ubuntu-latest, arch: x86_64, dicbuild: true} | |
- { name: linux, os: ubuntu-latest, arch: aarch64, crossbuild: crossbuild-essential-arm64} | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: ilammy/msvc-dev-cmd@v1 | |
with: | |
arch: ${{ matrix.arch }} | |
if: matrix.name == 'windows' | |
- name: Setup Python | |
uses: actions/setup-python@v4 | |
with: | |
python-version: '3.x' | |
- name: Install Python Dependencies | |
run: pip install meson ninja | |
- name: Install Dependencies (Linux) | |
run: sudo apt-get update && sudo apt-get install ${{ matrix.crossbuild }} qemu-user-static | |
if: matrix.name == 'linux' && matrix.arch != 'x86_64' | |
- name: Configure (Windows) | |
run: meson setup --prefix=C:\mecab -Db_vscrt=static_from_buildtype -Dbuildtype=debugoptimized -Dbuild_dic=false builddir | |
working-directory: ${{ github.workspace }} | |
if: matrix.name == 'windows' | |
- name: Configure (macOS) | |
run: meson setup --prefix=/opt/mecab -Dbuildtype=debugoptimized -Dbuild_dic=false builddir | |
working-directory: ${{ github.workspace }} | |
if: matrix.name == 'macos' && matrix.arch == 'x86_64' | |
- name: Configure (Crossbuild macOS) | |
run: meson setup --prefix=/opt/mecab -Dbuildtype=debugoptimized --cross-file=cross/${{ matrix.arch }}-darwin-clang.txt -Dbuild_dic=false builddir | |
working-directory: ${{ github.workspace }} | |
if: matrix.name == 'macos' && matrix.arch != 'x86_64' | |
- name: Configure (Linux) | |
run: meson setup --prefix=/opt/mecab -Dbuildtype=debugoptimized -Dbuild_static=true -Dbuild_dic=true builddir | |
working-directory: ${{ github.workspace }} | |
if: matrix.name == 'linux' && matrix.arch == 'x86_64' | |
- name: Configure (Crossbuild Linux) | |
run: meson setup --prefix=/opt/mecab -Dbuildtype=debugoptimized -Dbuild_static=true --cross-file=cross/${{ matrix.arch }}-linux-gnu.txt -Dbuild_dic=false builddir | |
working-directory: ${{ github.workspace }} | |
env: | |
QEMU_LD_PREFIX: /usr/${{ matrix.arch }}-linux-gnu/ | |
if: matrix.name == 'linux' && matrix.arch != 'x86_64' | |
- name: Build | |
run: meson compile -C builddir | |
working-directory: ${{ github.workspace }} | |
- name: Install | |
run: meson install -C builddir --destdir ../out | |
working-directory: ${{ github.workspace }} | |
- name: 7z (dic) | |
run: 7z a mecab-ko-dic.zip mecab-ko-dic | |
working-directory: ${{ github.workspace }}/out/opt/mecab/share | |
if: matrix.dicbuild | |
- name: tar (dic) | |
run: tar -cvzf mecab-ko-dic.tar.gz mecab-ko-dic | |
working-directory: ${{ github.workspace }}/out/opt/mecab/share | |
if: matrix.dicbuild | |
- name: Upload a Dictionary Artifact | |
uses: actions/upload-artifact@v3 | |
with: | |
path: out/opt/mecab/share/mecab-ko-dic.zip | |
if: matrix.dicbuild | |
- name: Release Dictionary | |
uses: softprops/action-gh-release@v1 | |
if: startsWith(github.ref, 'refs/tags/') && matrix.dicbuild | |
with: | |
files: out/opt/mecab/share/mecab-ko-dic.zip | |
- name: Upload a Dictionary Artifact | |
uses: actions/upload-artifact@v3 | |
with: | |
path: out/opt/mecab/share/mecab-ko-dic.tar.gz | |
if: matrix.dicbuild | |
- name: Release Dictionary | |
uses: softprops/action-gh-release@v1 | |
if: startsWith(github.ref, 'refs/tags/') && matrix.dicbuild | |
with: | |
files: out/opt/mecab/share/mecab-ko-dic.tar.gz | |
- name: Remove Dictionary | |
run: rm -rf mecab-ko-dic mecab-ko-dic.zip mecab-ko-dic.tar.gz | |
working-directory: ${{ github.workspace }}/out/opt/mecab/share | |
if: matrix.dicbuild | |
- name: 7z | |
run: 7z a mecab-ko-${{ matrix.name }}-${{ matrix.arch }}.zip mecab | |
working-directory: ${{ github.workspace }}/out | |
if: matrix.name == 'windows' | |
- name: tar | |
run: tar -cvzf mecab-ko-${{ matrix.name }}-${{ matrix.arch }}.tar.gz mecab | |
working-directory: ${{ github.workspace }}/out/opt | |
if: matrix.name != 'windows' | |
- name: Upload a Build Artifact | |
uses: actions/upload-artifact@v3 | |
with: | |
path: out/mecab-ko-${{ matrix.name }}-${{ matrix.arch }}.zip | |
if: matrix.name == 'windows' | |
- name: Release Artifact | |
uses: softprops/action-gh-release@v1 | |
if: startsWith(github.ref, 'refs/tags/') && matrix.name == 'windows' | |
with: | |
files: out/mecab-ko-${{ matrix.name }}-${{ matrix.arch }}.zip | |
- name: Upload a Build Artifact | |
uses: actions/upload-artifact@v3 | |
with: | |
path: out/opt/mecab-ko-${{ matrix.name }}-${{ matrix.arch }}.tar.gz | |
if: matrix.name != 'windows' | |
- name: Release Artifact | |
uses: softprops/action-gh-release@v1 | |
if: startsWith(github.ref, 'refs/tags/') && matrix.name != 'windows' | |
with: | |
files: out/opt/mecab-ko-${{ matrix.name }}-${{ matrix.arch }}.tar.gz | |
build_sdist: | |
name: Build sdist | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Setup Python | |
uses: actions/setup-python@v4 | |
with: | |
python-version: '3.x' | |
- name: Install Python Dependencies | |
run: pip install meson ninja build | |
- name: Build sdist | |
run: python -m build --sdist . | |
- uses: actions/upload-artifact@v3 | |
with: | |
name: python-artifact | |
path: ./dist/*.tar.gz | |
build_wheels: | |
name: Build wheels on ${{ matrix.os }} - ${{ matrix.cibw_arch }} | |
runs-on: ${{ matrix.os }} | |
strategy: | |
matrix: | |
include: | |
- { name: windows, os: windows-2019, msvc_arch: x64, cibw_arch: AMD64} | |
- { name: windows, os: windows-2019, msvc_arch: x86, cibw_arch: x86} | |
- { name: macos, os: macos-11, cibw_arch: x86_64} | |
- { name: macos, os: macos-11, cibw_arch: arm64} | |
- { name: linux, os: ubuntu-20.04, cibw_arch: auto} | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: ilammy/msvc-dev-cmd@v1 | |
with: | |
arch: ${{ matrix.msvc_arch }} | |
if: matrix.name == 'windows' | |
- name: Build wheels | |
uses: pypa/cibuildwheel@v2.13.1 | |
env: | |
CIBW_ARCHS: ${{ matrix.cibw_arch }} | |
- uses: actions/upload-artifact@v3 | |
with: | |
name: python-artifact | |
path: ./wheelhouse/*.whl | |
build_dic_wheel: | |
name: Build dic wheel | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Setup Python | |
uses: actions/setup-python@v4 | |
with: | |
python-version: '3.x' | |
- name: Install Python Dependencies | |
run: pip install meson ninja build | |
- name: Configure | |
run: meson setup builddir -Dbuild_dic=true -Dbuilding_pip_dic=true | |
working-directory: ${{ github.workspace }} | |
- name: Build | |
run: meson compile -C builddir | |
working-directory: ${{ github.workspace }} | |
- name: Build Wheel | |
run: python -m build . | |
working-directory: ${{ github.workspace }}/builddir | |
- uses: actions/upload-artifact@v3 | |
with: | |
name: python-artifact | |
path: ./builddir/dist/*.whl | |
upload_python_pkgs: | |
name: Upload Python Packages | |
needs: [build_sdist, build_wheels, build_dic_wheel] | |
runs-on: ubuntu-latest | |
if: startsWith(github.ref, 'refs/tags/') | |
steps: | |
- uses: actions/download-artifact@v4.1.7 | |
with: | |
name: python-artifact | |
path: dist | |
- uses: pypa/gh-action-pypi-publish@v1.5.0 | |
with: | |
user: ${{ secrets.pypi_user }} | |
password: ${{ secrets.pypi_password }} | |