forked from rdiff-backup/rdiff-backup
-
Notifications
You must be signed in to change notification settings - Fork 0
167 lines (158 loc) · 5.38 KB
/
weekly.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
---
name: Deploy-Weekly
on:
schedule: # Each Sunday (0) at 22:22 UTC
- cron: '22 22 * * 0'
# 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-weekly:
runs-on: ubuntu-latest
needs: [build-manylinux, build-sdist, test-built-windows]
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0 # to have the correct version
- name: Install setuptools-scm to be able to detect current version
run: |
sudo apt-get --assume-yes update
sudo apt-get --assume-yes install python3-setuptools-scm
pip install build # package python3-build is too old
- name: force create weekly tag and push it and create release body
run: |
git tag -f weekly && git push -f origin weekly
echo "This weekly release has been built and uploaded automatically." > body.myown.adoc
echo "Feel free to use (at your own risk) and report issues." >> body.myown.adoc
echo >> body.myown.adoc
./tools/get_changelog_since.sh -M >> body.myown.md
- 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: ncipollo/release-action@v1
with:
token: ${{ secrets.GITHUB_TOKEN }}
tag: weekly
# commit: master
name: Weekly Release ${{ github.event.repository.pushed_at }}
bodyFile: body.myown.md
prerelease: true
artifacts: ${{ steps.export.outputs.artifact_files }}
allowUpdates: true
removeArtifacts: true