Trigger aur deployment #115
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: Python Package | |
on: | |
push: | |
pull_request: | |
jobs: | |
build: | |
name: build | |
runs-on: ${{ matrix.os }} | |
strategy: | |
matrix: | |
os: [ubuntu-latest, windows-latest] | |
python: | |
- "3.7" | |
- "3.8" | |
- "3.9" | |
- "3.10" | |
defaults: | |
run: | |
shell: bash | |
steps: | |
- uses: actions/checkout@v2 | |
- uses: actions/setup-python@v2 | |
with: | |
python-version: ${{ matrix.python }} | |
- run: python -m pip install -U pip | |
- run: python -m pip install setuptools wheel | |
- run: python -m pip install flake8 twine | |
- run: python setup.py sdist bdist_wheel | |
- run: python -m pip install dist/*.whl | |
- run: twine check dist/* | |
- run: flake8 | |
- name: Generate PKGBUILD | |
run: | | |
MD5SUM=$(md5sum dist/*.tar.gz | cut -d ' ' -f1) | |
VERSION=$(python -c 'import steam_acolyte as s;print(s.__version__)') | |
sed .github/PKGBUILD >dist/PKGBUILD \ | |
-e "s/{{VERSION}}/$VERSION/" \ | |
-e "s/{{MD5SUM}}/$MD5SUM/" | |
cat dist/PKGBUILD | |
- uses: actions/upload-artifact@v2 | |
with: | |
name: dist | |
path: dist | |
if: matrix.os == 'ubuntu-latest' && | |
matrix.python == '3.8' | |
deploy: | |
name: Upload release | |
runs-on: ubuntu-latest | |
needs: build | |
steps: | |
- uses: actions/download-artifact@v2 | |
with: | |
name: dist | |
path: dist | |
- uses: actions/setup-python@v2 | |
with: | |
python-version: '3.x' | |
- run: pip install twine | |
- name: Extract release info | |
id: release | |
run: echo "::set-output name=tagname::${GITHUB_REF##*/}" | |
- name: Publish PyPI package | |
env: | |
TWINE_USERNAME: __token__ | |
TWINE_PASSWORD: ${{ secrets.PYPI_TOKEN }} | |
run: twine upload dist/*.whl dist/*.tar.gz | |
if: startsWith(github.ref, 'refs/tags/v') && success() | |
- name: Publish AUR package | |
uses: KSXGitHub/github-actions-deploy-aur@e07018655eeea52e5bf4bc4be386e2f503ad290b | |
with: | |
pkgname: steam-acolyte | |
pkgbuild: dist/PKGBUILD | |
commit_message: Update to ${{ steps.release.outputs.tagname }} | |
commit_username: acolyte | |
commit_email: ${{ secrets.AUR_EMAIL }} | |
ssh_private_key: ${{ secrets.AUR_SSH_PRIVATE_KEY }} |