Add GitHub Actions workflow to publish packages

This commit is contained in:
evgfilim1 2020-01-29 17:45:29 +05:00
parent da0b9a4203
commit aa280dfc64
No known key found for this signature in database
GPG key ID: 16AEE4D0BB188AEC
4 changed files with 186 additions and 0 deletions

48
.github/workflows/release.yml vendored Normal file
View file

@ -0,0 +1,48 @@
name: Publish packages
on:
push:
branches:
- 'releases/**'
tags:
- v3
- v3.*
jobs:
publish:
runs-on: ubuntu-latest
steps:
- name: Checkout repo
uses: actions/checkout@v2
- name: Set up Python 3.7
uses: actions/setup-python@v1
with:
python-version: 3.7
- name: Install dependencies
run: |
python -m pip install --upgrade pip poetry==1.0
- name: Build wheel
run: |
poetry build
- name: Publish to PyPI
env:
POETRY_PYPI_TOKEN_PYPI: ${{ secrets.PYPI_TOKEN }}
run: |
poetry publish
- name: Prepare AUR package
env:
AUR_SSH_KEY: ${{ secrets.AUR_SSH_KEY }}
GIT_EMAIL: ${{ secrets.GIT_EMAIL }}
GIT_NAME: ${{ secrets.GIT_NAME }}
run: >
docker build
./.github/workflows/aur
--build-arg AUR_SSH_KEY
--build-arg aiogram_ver="$(git describe --tags ${GITHUB_REF}
| sed -E 's/^v//')"
--build-arg GIT_EMAIL
--build-arg GIT_NAME
-t aiogram/aur
- name: Build and publish AUR package
run: |
docker run aiogram/aur build && docker run aiogram/aur publish