-
Notifications
You must be signed in to change notification settings - Fork 18
55 lines (49 loc) · 1.53 KB
/
package-publish.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
name: Upload to PYPI, AUR
on:
workflow_dispatch:
release:
types: [published]
permissions:
contents: read
jobs:
deploy_pypi:
runs-on: ubuntu-latest
environment: prod
steps:
- uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v3
with:
python-version: "3.10"
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install build
- name: Build package
run: python -m build -s
- name: Publish package
uses: pypa/gh-action-pypi-publish@release/v1
with:
user: __token__
password: ${{ secrets.PYPI_API_TOKEN }}
deploy_aur:
runs-on: ubuntu-latest
environment: prod
needs: deploy_pypi
steps:
- uses: actions/checkout@v3
- name: Create PKGBUILD dir
run: mkdir -p ./pkg/
- name: Build PKGBUILD
run: sed "s/pkgver=VERSION/pkgver=$(cat pyproject.toml | grep -E 'version = "[0-9\.]+"' -o | grep -E "[0-9\.]+" -o)/" PKGBUILD > ./pkg/PKGBUILD
- name: Publish AUR package
uses: KSXGitHub/github-actions-deploy-aur@v2.7.0
with:
pkgname: hhd
pkgbuild: ./pkg/PKGBUILD
commit_username: ${{ secrets.AUR_USERNAME }}
commit_email: ${{ secrets.AUR_EMAIL }}
ssh_private_key: ${{ secrets.AUR_SSH_PRIVATE_KEY }}
commit_message: update to '${{ github.event.release.name }}'
allow_empty_commits: false
ssh_keyscan_types: rsa,dsa,ecdsa,ed25519