Skip to content

Commit

Permalink
Add actions
Browse files Browse the repository at this point in the history
  • Loading branch information
Eeems committed Dec 28, 2023
1 parent 5c42267 commit 66a7e93
Showing 1 changed file with 76 additions and 0 deletions.
76 changes: 76 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
name: Check and Build
on:
push:
branches:
- main
pull_request:
workflow_dispatch:
release:
types: [released]
permissions: read-all
jobs:
build-wheel:
name: Build wheel with python ${{ matrix.python }}
runs-on: ubuntu-latest
strategy:
matrix:
python:
- '3.12'
- '3.11'
steps:
- name: Checkout the Git repository
uses: actions/checkout@v3
- name: Setup Python
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python }}
cache: 'pip'
- name: Install build tool
run: pip install build
- name: Building package
run: python -m build --wheel
- uses: actions/upload-artifact@v4
with:
name: pip
path: dist/*
if-no-files-found: error
build-sdist:
name: Build sdist
runs-on: ubuntu-latest
steps:
- name: Checkout the Git repository
uses: actions/checkout@v3
- name: Setup Python
uses: actions/setup-python@v4
with:
python-version: '3.11'
cache: 'pip'
- name: Install build tool
run: pip install build
- name: Building package
run: python -m build --sdist
- uses: actions/upload-artifact@v4
with:
name: pip
path: dist/*
if-no-files-found: error
publish:
name: Publish to PyPi
runs-on: ubuntu-latest
needs: [build-sdist, build-wheel]
if: github.repository == 'Eeems-Org/remarkable-update-fuse' && github.event_name == 'release' && startsWith(github.ref, 'refs/tags')
permissions:
id-token: write
environment:
name: pypi
url: https://pypi.org/p/remarkable_update_fuse
steps:
- name: Download pip packages
id: download
uses: actions/download-artifact@v4
with:
name: pip
- name: Publish package distributions to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
packages-dir: ${{ steps.download.outputs.download-path }}

0 comments on commit 66a7e93

Please sign in to comment.