Skip to content

Workflow file for this run

name: publish executable file to release page
# releaseページにWindows用の実行ファイルをアップロードする。windowsはpython環境の構築に少し手間がかかるので、実行可能ファイルを用意する。
on:
release:
types:
- published
jobs:
windows-build: # Windows向けビルド
runs-on: windows-latest
steps:
- name: Checkout commit
uses: actions/checkout@main
- name: Set up Python 3.9
uses: actions/setup-python@main
with: { python-version: 3.9 }
- name: Upgrade pip, and install poetry, pyinstaller
run: |
python -m pip install --upgrade pip
python -m pip install "poetry<1.5"
- name: poetry install
run: poetry install --only main,publish
- name: create executable file
run: |
mv annofabcli\__main__.py annofabcli\annofabcli.py
poetry run pyinstaller annofabcli\annofabcli.py --add-data "annofabcli/data/logging.yaml;annofabcli/data"
- name: upload
uses: actions/upload-artifact@v1
with:
name: annofabcli-windows
path: dist
release:
needs: [windows-build]
runs-on: ubuntu-latest
steps:
- name: Set version
id: version
run: |
REPOSITORY=$(echo ${{ github.repository }} | sed -e "s#.*/##")
VERSION=$(echo ${{ github.ref }} | sed -e "s#refs/tags/##g")
echo ::set-output name=version::$VERSION
echo ::set-output name=filename::$REPOSITORY-$VERSION
- name: Download Windows
uses: actions/download-artifact@v1
with:
name: annofabcli-windows
- name: Zip
run: |
zip -r annofabcli-windows.zip annofabcli-windows
- name: Append Binary
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ github.event.release.upload_url }}
asset_path: ./annofabcli-windows.zip
asset_name: annofabcli-${{ steps.version.outputs.version }}-windows.zip
asset_content_type: application/zip