-
Notifications
You must be signed in to change notification settings - Fork 38
91 lines (74 loc) · 2.57 KB
/
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
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
86
87
88
89
90
91
name: Publish
on:
push:
tags:
- 'v*.*.*'
jobs:
ghrelease:
name: Create GitHub release for BlueChi
runs-on: ubuntu-latest
container:
image: quay.io/bluechi/build-base:latest
steps:
- name: Checkout sources
uses: actions/checkout@v4
with:
fetch-depth: 0
submodules: 'true'
- name: Mark source directory as safe
run: |
git config --global --add safe.directory $(pwd)
- name: Build source rpm
run: |
./build-scripts/build-srpm.sh
- name: Get BlueChi version
run: |
echo "BLUECHI_VERSION=$(./build-scripts/version.sh)" >> $GITHUB_ENV
- name: Create source zip and tarball
run: |
mkdir -p /tmp/bluechi-${{ env.BLUECHI_VERSION }}
cp -r ./ /tmp/bluechi-${{ env.BLUECHI_VERSION }}/
rm -rf /tmp/bluechi-${{ env.BLUECHI_VERSION }}/.git/
mv /tmp/bluechi-${{ env.BLUECHI_VERSION }}/ ./
zip -r bluechi-${{ env.BLUECHI_VERSION }}.zip bluechi-${{ env.BLUECHI_VERSION }}/
tar czf bluechi-${{ env.BLUECHI_VERSION }}.tar.gz bluechi-${{ env.BLUECHI_VERSION }}/
- name: Release
uses: softprops/action-gh-release@v2
if: startsWith(github.ref, 'refs/tags/')
with:
generate_release_notes: true
prerelease: false
draft: false
token: ${{ secrets.GH_RELEASE_TOKEN }}
files: |
bluechi-${{ env.BLUECHI_VERSION }}.zip
bluechi-${{ env.BLUECHI_VERSION }}.tar.gz
rpmbuild/SRPMS/*.src.rpm
pypipublish:
name: Publish bluechi on PyPi
runs-on: ubuntu-latest
container:
image: quay.io/bluechi/build-base:latest
steps:
- name: Checkout sources
uses: actions/checkout@v4
with:
submodules: 'true'
- name: Install dependencies
run: |
dnf install python3-gobject -y
python3 -m ensurepip --default-pip
python3 -m pip install --upgrade pip setuptools wheel build
python3 -m pip install -r requirements.txt
python3 -m pip install -r src/bindings/generator/requirements.txt
- name: Generate python bindings
run: |
./build-scripts/generate-bindings.sh python
- name: Build python bindings package
run: |
./build-scripts/build-bindings.sh python
- name: Publish bluechi to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
password: ${{ secrets.PYPI_API_TOKEN }}
packages-dir: src/bindings/python/dist/