v0.8.2 #30
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: Publishing | |
on: | |
release: | |
types: | |
- published | |
jobs: | |
pypi-publish: | |
name: PyPI | |
if: github.repository_owner == 'juftin' | |
runs-on: ubuntu-latest | |
steps: | |
- name: Check out the repository | |
uses: actions/checkout@v3 | |
with: | |
fetch-depth: 2 | |
- name: Set up Python | |
uses: actions/setup-python@v4 | |
with: | |
python-version: '3.10' | |
- name: Install Hatch | |
run: | | |
python -m pip install --upgrade pip | |
python -m pip install -q hatch | |
hatch -v env create | |
hatch --version | |
- name: Build package | |
run: | | |
hatch build | |
- name: Publish package on PyPI | |
uses: pypa/[email protected] | |
with: | |
user: __token__ | |
password: ${{ secrets.PYPI_TOKEN }} | |
docker-hub-publish: | |
name: docker-hub | |
if: github.repository_owner == 'juftin' | |
runs-on: ubuntu-latest | |
steps: | |
- name: Check out the repository | |
uses: actions/checkout@v3 | |
with: | |
fetch-depth: 2 | |
- name: Set up Python | |
uses: actions/setup-python@v4 | |
with: | |
python-version: '3.10' | |
- name: Install Hatch | |
run: | | |
python -m pip install --upgrade pip | |
python -m pip install -q hatch | |
hatch -v env create | |
hatch --version | |
- name: Set up QEMU | |
uses: docker/setup-qemu-action@v1 | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v1 | |
- name: Login to DockerHub | |
uses: docker/login-action@v2 | |
with: | |
username: ${{ secrets.DOCKER_USERNAME }} | |
password: ${{ secrets.DOCKER_TOKEN }} | |
- name: Declare Version Variable | |
run: | | |
PACKAGE_VERSION=$(hatch version) | |
PACKAGE_NAME=$(hatch project metadata | jq -r .name) | |
echo PACKAGE_VERSION=${PACKAGE_VERSION} >> $GITHUB_ENV | |
echo PACKAGE_NAME=${PACKAGE_NAME} >> $GITHUB_ENV | |
- name: Docker Image Building and Publishing | |
id: docker_build | |
uses: docker/build-push-action@v2 | |
with: | |
push: true | |
tags: juftin/${{ env.PACKAGE_NAME }}:latest,juftin/${{ env.PACKAGE_NAME }}:${{ env.PACKAGE_VERSION }} |