Skip to content

Commit

Permalink
github: Add CI/deployment workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
avdgrinten committed Jun 19, 2022
1 parent 314222b commit b0fe4da
Showing 1 changed file with 44 additions and 0 deletions.
44 changes: 44 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
name: CI

on: [push, pull_request]

jobs:
build:
name: Build source package
runs-on: ubuntu-20.04
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Building using setuptools
run: |
./setup.py sdist
- name: Upload artifact
uses: actions/upload-artifact@v2
with:
name: packages
path: dist/xbstrap-*.tar.gz

deploy:
name: Publish release
runs-on: ubuntu-20.04
if: "startsWith(github.ref, 'refs/tags/v')"
needs: build
steps:
- name: Fetch artifact
uses: actions/download-artifact@v2
with:
name: packages
path: artifact
- name: Prepare dist/ directory
run: |
mkdir dist/
# Get exactly the version that we want to publish.
version="$(grep -Po '(?<=^refs/tags/v).+$' <<< "$ref")"
mv "artifact/xbstrap-$version.tar.gz" dist/
env:
ref: ${{ github.ref }}
- name: Publish to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
user: __token__
password: ${{ secrets.PYPI_API_TOKEN }}

0 comments on commit b0fe4da

Please sign in to comment.