Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
65 changes: 65 additions & 0 deletions .github/workflows/image.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
# This workflow will upload a Python Package using Twine when a release is created
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python#publishing-to-package-registries

# This workflow uses actions that are not certified by GitHub.
# They are provided by a third-party and are governed by
# separate terms of service, privacy policy, and support
# documentation.

name: Upload Python Package

on:
push:
tags:
- v*.*.*

jobs:
deploy:

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- name: Set up Python 3.8
uses: actions/setup-python@v3
with:
python-version: '3.8'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install build
- name: Update setup script with version (tag) name
run : |
sed -i "s/PACKAGE_VERSION/${{ github.ref_name }}/" setup.py
- name: Update CHAP.version with version (tag) name
run : |
sed -i "s/PACKAGE_VERSION/${{ github.ref_name }}/" CHAP/__init__.py
- name: Build package
run: python -m build

- name: Set up QEMU
uses: docker/setup-qemu-action@v3

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

- name: Build image
run: |
docker buildx build --platform linux/amd64 \
-t ghcr.io/chesscomputing/chap:${{ steps.branch_name.outputs.SOURCE_TAG }} .

- name: Login to ghcr.io registry
uses: docker/login-action@v1.6.0
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Publish image
uses: docker/build-push-action@v2
with:
push: true
platforms: linux/amd64
tags: |
ghcr.io/chesscomputing/chap:latest
ghcr.io/chesscomputing/chap:${{ steps.branch_name.outputs.SOURCE_TAG }}