forked from rdiff-backup/rdiff-backup
-
Notifications
You must be signed in to change notification settings - Fork 0
201 lines (191 loc) · 6.44 KB
/
deploy.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
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
---
name: Deploy-All
on:
push:
branches: ['*_']
tags:
- '*_' # ending underscore for trying things
- 'v[0-9]+.[0-9]+.[0-9]+' # final version
- 'v[0-9]+.[0-9]+.[0-9]+[abrc]+[0-9]+' # alpha, beta, release candidate (rc)
- 'v[0-9]+.[0-9]+.[0-9]+.dev[0-9]+' # development versions
# necessary for Windows
defaults:
run:
shell: bash
env:
WIN_PYTHON_VERSION: 3.12.0
WIN_LIBRSYNC_VERSION: v2.3.4
jobs:
build-manylinux:
runs-on: ubuntu-latest
strategy:
matrix:
#--- Build and deploy Linux wheels using manylinux containers ---
many-linux: [_2_28_x86_64]
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0 # to have the correct version
- name: create manylinux wheel(s) in a container
uses: addnab/docker-run-action@v1
with:
image: quay.io/pypa/manylinux${{ matrix.many-linux }}
options: -v ${{ github.workspace }}:/ws
run: |
if [[ ${{ matrix.many-linux }} != *64 ]]; then PRE_CMD=linux32; fi
#py=$(echo ${{ matrix.python-version }} | tr -d .)
plat=manylinux${{ matrix.many-linux }}
$PRE_CMD /ws/tools/build_wheels.sh /ws ${plat} /opt/python/cp3{12,11,10,9}*/bin
- name: Upload wheel artifacts
uses: actions/upload-artifact@v4
with:
name: package-artifacts-linux-${{ matrix.many-linux }}
path: dist/*.whl
if-no-files-found: error
build-sdist:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0 # to have the correct version
- name: Install asciidoctor to generate manpages and other dependencies
run: |
sudo apt-get --assume-yes update
sudo apt-get --assume-yes install asciidoctor
- name: create source dist package
run: |
pip install build # package python3-build is too old
pyproject-build --sdist
- name: Upload sdist artifact
uses: actions/upload-artifact@v4
with:
name: package-artifacts-sdist
path: dist/*.tar.gz
if-no-files-found: error
build-windows:
runs-on: windows-latest
strategy:
matrix:
arch: [x86, x64]
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0 # to have the correct version
- name: Set up Python ${{ env.WIN_PYTHON_VERSION }}
uses: actions/setup-python@v5
with:
python-version: ${{ env.WIN_PYTHON_VERSION }}
architecture: ${{ matrix.arch }}
- name: Install dependencies
run: tools/win_provision.sh asciidoc
- name: Build librsync
run: tools/win_build_librsync.sh ${{ matrix.arch }} ${WIN_LIBRSYNC_VERSION}
- name: Build rdiff-backup
run: tools/win_build_rdiffbackup.sh ${{ matrix.arch }} ${WIN_PYTHON_VERSION}
- name: Package rdiff-backup
run: tools/win_package_rdiffbackup.sh ${{ matrix.arch }}
- name: Upload artifacts
uses: actions/upload-artifact@v4
with:
name: package-artifacts-win-${{ matrix.arch }}
path: |
dist/*.zip
dist/*.whl
if-no-files-found: error
test-built-windows:
runs-on: windows-latest
needs: [build-windows]
strategy:
matrix:
arch: [x86, x64]
steps:
- name: Download artifacts
id: download
uses: actions/download-artifact@v4
with:
name: package-artifacts-win-${{ matrix.arch }}
path: .
- name: Extract and test Windows binary
run: |
ls -la
if [[ ${{ matrix.arch }} == *64 ]]; then bits=64; else bits=32; fi
7z x rdiff-backup-*.win${bits}exe.zip
cd rdiff-backup-*-${bits}
pwd
ls -la
./rdiff-backup.exe --help
./rdiff-backup.exe info
./rdiff-backup.exe -v5 backup . ../bak${bits}
./rdiff-backup.exe -v5 verify ../bak${bits}
./rdiff-backup.exe -v5 restore ../bak${bits} to
ls -la to/
release:
runs-on: ubuntu-latest
needs: [build-manylinux, build-sdist, test-built-windows]
steps:
- name: Download artifacts
id: download
uses: actions/download-artifact@v4
with:
pattern: package-artifacts-*
path: dist
merge-multiple: true
- name: Export artifacts
id: export
run: echo artifact_files=${{ steps.download.outputs.download-path }}/*.* >> $GITHUB_OUTPUT
# see https://jasonet.co/posts/new-features-of-github-actions/#passing-data-to-future-steps
- name: Create release and upload assets to GitHub
uses: meeDamian/[email protected]
with:
token: ${{ secrets.GITHUB_TOKEN }}
tag: ${{ github.ref }}
name: Release ${{ github.ref }} ${{ github.event_name }}
draft: true
prerelease: true
files: ${{ steps.export.outputs.artifact_files }}
gzip: false
- name: Install twine
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v')
run: |
sudo python -m pip install --upgrade pip
sudo pip install twine
- name: publish to test PyPI repository
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v') && contains(github.ref, '.dev')
env:
TWINE_USERNAME: __token__
TWINE_PASSWORD: ${{ secrets.PYPI_TOKEN_TEST }}
TWINE_REPOSITORY_URL: https://test.pypi.org/legacy/
run: |
twine upload --skip-existing --verbose dist/rdiff*.{whl,tar.gz}
# old versions don't understand --non-interactive
- name: publish to PyPI repository
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v') && ! contains(github.ref, '.dev')
env:
TWINE_USERNAME: __token__
TWINE_PASSWORD: ${{ secrets.PYPI_TOKEN }}
run: |
twine upload --skip-existing --verbose dist/rdiff*.{whl,tar.gz}
# old versions don't understand --non-interactive
# #--- Build Debian packages ---
# - os: linux
# language: shell
# env: MAKE_STEP=dist_deb RUN_COMMAND=
# addons:
# apt:
# packages: # make sure these match debian/control contents
# - build-essential
# - debhelper-compat
# - dh-python
# - fakeroot
# - git-buildpackage
# - librsync-dev
# - python3-all-dev
# - python3-pylibacl
# - python3-pyxattr
# - python3-setuptools
# - python3-setuptools-scm
# install:
# - echo "No pip here"
# script:
# - make $MAKE_STEP
# - cat ../*.changes