Skip to content

Commit 07bf652

Browse files
committed
cd: add package deploy workflow
This workflow is intended to run on a tag push for creating and deploying module packages to S3 based repositories. Closes #43
1 parent ee432f9 commit 07bf652

File tree

1 file changed

+91
-0
lines changed

1 file changed

+91
-0
lines changed

.github/workflows/packaging.yml

Lines changed: 91 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,91 @@
1+
name: packaging
2+
3+
on:
4+
pull_request:
5+
workflow_dispatch:
6+
push:
7+
branches:
8+
- 'master'
9+
tags:
10+
- '*'
11+
12+
jobs:
13+
package:
14+
runs-on: ubuntu-latest
15+
16+
strategy:
17+
fail-fast: false
18+
matrix:
19+
platform:
20+
- { os: 'debian', dist: 'stretch' }
21+
- { os: 'debian', dist: 'buster' }
22+
- { os: 'debian', dist: 'bullseye' }
23+
- { os: 'el', dist: '7' }
24+
- { os: 'el', dist: '8' }
25+
- { os: 'fedora', dist: '30' }
26+
- { os: 'fedora', dist: '31' }
27+
- { os: 'fedora', dist: '32' }
28+
- { os: 'fedora', dist: '33' }
29+
- { os: 'fedora', dist: '34' }
30+
- { os: 'fedora', dist: '35' }
31+
- { os: 'fedora', dist: '36' }
32+
- { os: 'ubuntu', dist: 'xenial' }
33+
- { os: 'ubuntu', dist: 'bionic' }
34+
- { os: 'ubuntu', dist: 'focal' }
35+
- { os: 'ubuntu', dist: 'groovy' }
36+
- { os: 'ubuntu', dist: 'jammy' }
37+
38+
env:
39+
OS: ${{ matrix.platform.os }}
40+
DIST: ${{ matrix.platform.dist }}
41+
42+
steps:
43+
- name: Clone the module
44+
uses: actions/checkout@v3
45+
# `actions/checkout` performs shallow clone of repo. To provide
46+
# proper version of the package to `packpack` we need to have
47+
# complete repository, otherwise it will be `0.0.1`.
48+
with:
49+
fetch-depth: 0
50+
51+
- name: Clone the packpack tool
52+
uses: actions/checkout@v3
53+
with:
54+
repository: packpack/packpack
55+
path: packpack
56+
57+
- name: Fetch tags
58+
# Found that Github checkout Actions pulls all the tags, but
59+
# right it deannotates the testing tag, check:
60+
# https://github.com/actions/checkout/issues/290
61+
# But we use 'git describe ..' calls w/o '--tags' flag and it
62+
# prevents us from getting the needed tag for packages version
63+
# setup. To avoid of it, let's fetch it manually, to be sure
64+
# that all tags will exist always.
65+
run: git fetch --tags -f
66+
67+
- name: Create packages
68+
run: ./packpack/packpack
69+
70+
- name: Deploy packages
71+
# We need this step to run only on push with tag.
72+
if: ${{ github.event_name == 'push' && startsWith(github.ref, 'refs/tags/') }}
73+
env:
74+
RWS_URL_PART: https://rws.tarantool.org/tarantool-modules
75+
RWS_AUTH: ${{ secrets.RWS_AUTH }}
76+
PRODUCT_NAME: tarantool-expirationd
77+
working-directory: build
78+
run: |
79+
CURL_CMD="curl -LfsS \
80+
-X PUT ${RWS_URL_PART}/${OS}/${DIST} \
81+
-u ${RWS_AUTH} \
82+
-F product=${PRODUCT_NAME}"
83+
84+
shopt -s nullglob
85+
for f in *.deb *.rpm *.dsc *.tar.xz *.tar.gz; do
86+
CURL_CMD+=" -F $(basename ${f})=@${f}"
87+
done
88+
89+
echo ${CURL_CMD}
90+
91+
${CURL_CMD}

0 commit comments

Comments
 (0)