-
Notifications
You must be signed in to change notification settings - Fork 79
87 lines (81 loc) · 2.48 KB
/
reuseable_build_package.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
86
87
name: "Build Sovrin Package"
on:
workflow_call:
inputs:
isDev:
required: false
default: true
type: boolean
jobs:
timestamp:
name: Get timestamp
runs-on: ubuntu-latest
outputs:
timestamp: ${{ steps.timestamp.outputs.timestamp }}
steps:
- id: timestamp
run: |
export timestamp=$(date +%s)
echo "timestamp=$timestamp" >> $GITHUB_OUTPUT
echo "::group::DEBUG"
echo "timestamp=$timestamp"
echo "::endgroup::"
build_sovrin:
name: Build Sovrin Deb
runs-on: ubuntu-20.04
needs: timestamp
steps:
- name: Git Checkout
uses: actions/checkout@v4
- name: setup
run: |
sudo apt-get update && sudo apt-get -y install rubygems
sudo gem install fpm
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.8'
- name: Set up python
run: |
pip3 install semver
- name: Set Version with UX-timestamp
if: ${{ inputs.isDev }}
run: python3 updateVersion.py --timestamp ${{ needs.timestamp.outputs.timestamp }}
- name: Get current Version
id: version
run: |
version=$(python3 updateVersion.py --getVersion)
debVersion=$(sed -r "s/-/~/g" <<< $version)
echo "debVersion=$debVersion">>$GITHUB_OUTPUT
- name: Build Sovrin Deb
run: sudo bash ./build-scripts/ubuntu-2004/build-sovrin.sh "./" "${{ steps.version.outputs.debVersion }}" "$PWD"
- name: Upload sovrin.deb
uses: actions/upload-artifact@v4
with:
name: sovrin-deb
path: ./sovrin_*.deb
retention-days: 5
build_sovrin_pypi:
name: Sovrin Build Pypi
runs-on: ubuntu-20.04
needs: timestamp
steps:
- name: Check out code
uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.8'
- name: Set up python
run: |
pip3 install semver wheel
- name: Set Version with UX-timestamp
if: ${{ inputs.isDev }}
run: python3 updateVersion.py --timestamp ${{ needs.timestamp.outputs.timestamp }}
- name: Build python sovrin package
run: python3 setup.py sdist --dist-dir /tmp/dist bdist_wheel --dist-dir /tmp/dist
- uses: actions/upload-artifact@v4
with:
name: sovrin-python
path: /tmp/dist
retention-days: 5