Feat/nix darwin (#103) #4
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: Atils Build and Publish | |
on: | |
push: | |
branches: | |
- master | |
paths: | |
- 'atils/**' | |
- '.github/workflows/atils-run-ci.yaml' | |
jobs: | |
build-and-publish-docker-image: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 | |
- name: Get atils version | |
run: echo "VERSION=$(grep -E '^version = "' atils/pyproject.toml | cut -d'"' -f2)" >> $GITHUB_ENV | |
- name: Set up QEMU | |
uses: docker/setup-qemu-action@v3 | |
- name: Set up Docker Buildx | |
id: buildx | |
uses: docker/setup-buildx-action@v3 | |
- name: Login to Docker Hub | |
uses: docker/login-action@v3 | |
with: | |
username: ${{ secrets.DOCKERHUB_USERNAME }} | |
password: ${{ secrets.DOCKERHUB_TOKEN }} | |
- name: Build and publish atils image | |
uses: docker/build-push-action@v6 | |
with: | |
push: true | |
file: atils/Dockerfile | |
context: atils | |
tags: | | |
aidanhilt/atils:${{ env.VERSION }} | |
aidanhilt/atils:latest | |
platforms: linux/amd64, linux/arm64 | |
build-and-publish-python-package: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 | |
- name: Setup python with pyproject.toml-specified version | |
uses: actions/setup-python@v5 | |
with: | |
python-version-file: 'atils/pyproject.toml' | |
- name: Install and configure Poetry | |
uses: snok/install-poetry@v1 | |
- name: Install dependencies | |
run: poetry install -n -vv | |
working-directory: atils | |
- name: Build and publish package to PyPI | |
run: | | |
poetry config pypi-token.pypi $PYPI_API_TOKEN | |
poetry build | |
poetry publish -n -vv | |
working-directory: atils | |
env: | |
PYPI_API_TOKEN: ${{ secrets.ATILS_PYPI_TOKEN }} |