Skip to content

cleanup

cleanup #126

Workflow file for this run

# SPDX-FileCopyrightText: 2022 Pepijn de Vos
#
# SPDX-License-Identifier: MPL-2.0
name: CI
on:
push:
branches: [ main ]
tags: [ 'v*' ]
workflow_dispatch:
jobs:
build:
name: Build distribution πŸ“¦
runs-on: ubuntu-latest
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v2
- name: Setup Java 21
uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: '21'
- name: Setup Python
uses: actions/setup-python@v4
with:
python-version: '3.11'
- name: Install Python build dependencies
run: |
python -m pip install --upgrade pip
pip install build marimo
- name: Build JS (required for Python packages)
run: |
npm install
npx shadow-cljs release frontend
- name: Build Python packages
run: |
mkdir -p public/wheels
# Build nyancad package
cd python/nyancad
python -m build --outdir ../../public/wheels
cd ../..
# Build nyancad-server package
cd python/nyancad-server
python -m build --outdir ../../public/wheels
cd ../..
- name: Store nyancad distribution packages
uses: actions/upload-artifact@v4
with:
name: nyancad-distributions
path: public/wheels/nyancad-*
- name: Store nyancad-server distribution packages
uses: actions/upload-artifact@v4
with:
name: nyancad-server-distributions
path: public/wheels/nyancad_server-*
- name: Setup SSH key
uses: webfactory/[email protected]
with:
ssh-private-key: ${{ secrets.SSH_PRIVATE_KEY }}
- name: Add SSH host key
run: |
mkdir -p ~/.ssh
ssh-keyscan -H nyancad.com >> ~/.ssh/known_hosts
- name: Deploy to server via rsync πŸš€
run: |
rsync -avz --delete public/* [email protected]:/var/www/nyancad.com/
publish-nyancad-to-pypi:
name: Publish nyancad 🐍 distribution πŸ“¦ to PyPI
if: startsWith(github.ref, 'refs/tags/')
needs:
- build
runs-on: ubuntu-latest
steps:
- name: Download nyancad distributions
uses: actions/download-artifact@v4
with:
name: nyancad-distributions
path: dist/
- name: Publish nyancad distribution πŸ“¦ to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
password: ${{ secrets.PYPI_API_TOKEN }}
publish-nyancad-server-to-pypi:
name: Publish nyancad-server 🐍 distribution πŸ“¦ to PyPI
if: startsWith(github.ref, 'refs/tags/')
needs:
- build
runs-on: ubuntu-latest
steps:
- name: Download nyancad-server distributions
uses: actions/download-artifact@v4
with:
name: nyancad-server-distributions
path: dist/
- name: Publish nyancad-server distribution πŸ“¦ to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
password: ${{ secrets.PYPI_API_TOKEN }}