-
Notifications
You must be signed in to change notification settings - Fork 16
85 lines (83 loc) · 2.75 KB
/
build.yaml
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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
name: Build and push to PyPI on merging to master
on:
push:
branches:
- master
jobs:
git-tag-and-release:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Get version number
run: |
VERSION="$(grep ':Version:' README.rst | awk '{print $2}')"
echo "DIST_VERSION=v${VERSION}" >> $GITHUB_ENV
- name: Create Tag
uses: actions/github-script@v6
with:
script: |
const {DIST_VERSION} = process.env
github.rest.git.createRef({
owner: context.repo.owner,
repo: context.repo.repo,
ref: `refs/tags/${DIST_VERSION}`,
sha: context.sha
})
- name: Create GitHub Release
uses: ncipollo/release-action@v1
with:
name: "${{ env.DIST_VERSION }}"
tag: "${{ env.DIST_VERSION }}"
generateReleaseNotes: true
token: ${{ secrets.GITHUB_TOKEN }}
pypi-release:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up Python 3.11
uses: actions/setup-python@v4
with:
python-version: 3.11
- name: Install pypa/build
run: python -m pip install build --user
- name: Build a binary wheel and a source tarball
run: python -m build --sdist --wheel --outdir dist/
- name: Publish to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
password: ${{ secrets.PYPI_API_TOKEN }}
aur-release:
needs: pypi-release
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up Python 3.11
uses: actions/setup-python@v4
with:
python-version: 3.11
- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install tomli
- name: Generate PKGBUILD
run: python ./bin/gen_PKGBUILD.py > ./PKGBUILD
- name: Get version number
run: |
VERSION="$(cat ./PKGBUILD | grep pkgver= | awk -F= '{print $2}')"
echo "DIST_VERSION=${VERSION}" >> $GITHUB_ENV
- name: Wait for PyPi
uses: nev7n/wait_for_response@v1
with:
url: "https://files.pythonhosted.org/packages/source/a/anesthetic/anesthetic-${{ env.DIST_VERSION }}.tar.gz"
responseCode: 200
timeout: 600000
interval: 10000
- name: Publish AUR package
uses: KSXGitHub/[email protected]
with:
pkgname: python-anesthetic
pkgbuild: ./PKGBUILD
updpkgsums: True
commit_username: ${{ secrets.AUR_USERNAME }}
commit_email: ${{ secrets.AUR_EMAIL }}
ssh_private_key: ${{ secrets.AUR_SSH_PRIVATE_KEY }}