Update version to 1.5.1 #24
Workflow file for this run
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: deploy | |
on: | |
push: | |
tags: | |
- "*.*.*" | |
jobs: | |
build_and_deploy_wheel: | |
if: github.repository == 'sapporo-wes/sapporo-service' | |
runs-on: ubuntu-20.04 | |
steps: | |
- name: "Checkout" | |
uses: actions/checkout@v3 | |
with: | |
fetch-depth: 1 | |
- name: "Install dependencies" | |
run: | | |
python3 -m pip install --no-cache-dir --progress-bar off -U pip setuptools wheel | |
python3 -m pip install twine | |
- name: "Build distributions" | |
run: | | |
python3 setup.py sdist | |
python3 setup.py bdist_wheel | |
- name: "Verify distributions" | |
run: twine check dist/* | |
- name: "Publish distribution to PyPI" | |
env: | |
TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }} | |
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }} | |
run: twine upload dist/* | |
- name: "Upload sdist" | |
uses: actions/upload-artifact@v3 | |
with: | |
name: sdist | |
path: dist/sapporo-${{ github.ref_name }}.tar.gz | |
- name: "Upload wheel" | |
uses: actions/upload-artifact@v3 | |
with: | |
name: wheel | |
path: dist/sapporo-${{ github.ref_name }}-py3-none-any.whl | |
deploy_ghcr: | |
if: github.repository == 'sapporo-wes/sapporo-service' | |
runs-on: ubuntu-20.04 | |
steps: | |
- name: "Checkout" | |
uses: actions/checkout@v3 | |
with: | |
fetch-depth: 1 | |
- name: "Set up QEMU" | |
uses: docker/setup-qemu-action@v2 | |
- name: "Set up Docker Buildx" | |
uses: docker/setup-buildx-action@v2 | |
- name: "Login to GitHub Container Registry" | |
uses: docker/login-action@v2 | |
with: | |
registry: ghcr.io | |
username: ${{ github.repository_owner }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
- name: "Build and push" | |
uses: docker/build-push-action@v3 | |
with: | |
context: . | |
platforms: linux/amd64,linux/arm64 | |
push: true | |
tags: | | |
ghcr.io/${{ github.repository_owner }}/sapporo-service:${{ github.ref_name }} | |
ghcr.io/${{ github.repository_owner }}/sapporo-service:latest | |
create_release: | |
if: github.repository == 'sapporo-wes/sapporo-service' | |
needs: [build_and_deploy_wheel] | |
runs-on: ubuntu-20.04 | |
steps: | |
- name: "Download sdist" | |
uses: actions/download-artifact@v2 | |
with: | |
name: sdist | |
- name: "Download sdist" | |
uses: actions/download-artifact@v2 | |
with: | |
name: wheel | |
- name: "Release" | |
run: gh release --repo ${{ github.repository }} create ${{ github.ref_name }} --title ${{ github.ref_name }} --generate-notes sapporo-${{ github.ref_name }}.tar.gz sapporo-${{ github.ref_name }}-py3-none-any.whl | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |