forked from adobe-apiplatform/user-sync.py
219 lines (201 loc) · 6.03 KB
/
package-release.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
202
203
204
205
206
207
208
209
210
211
name: Package and Release
on:
push:
tags:
- 'v*'
workflow_dispatch:
jobs:
ubuntu:
runs-on: ubuntu-latest
strategy:
matrix:
include:
- extension_support: 0
variant_tag: "-noext"
- extension_support: 1
variant_tag: ""
steps:
- uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: '3.6'
- name: Get version tag
id: get_version
uses: battila7/get-version-action@v2
- name: Ubuntu-Install dependencies
run: |
sudo apt-get update
sudo apt-get install -y software-properties-common
sudo apt-get install -y build-essential
sudo apt-get install -y python3-dev python3-pip python3-virtualenv
sudo apt-get install -y pkg-config libssl-dev libdbus-1-dev libdbus-glib-1-dev python-dbus libffi-dev libkrb5-dev
- run: |
pip install external/okta-0.0.3.1-py2.py3-none-any.whl
pip install -e .
pip install -e .[test]
pip install -e .[setup]
- name: Make standalone
run: make standalone
env:
UST_EXTENSION: ${{matrix.extension_support}}
- name: Test with pytest
run: pytest
- name: Get build
run: |
cd dist
tar czf "user-sync-${UST_VERSION}${UST_VARIANT_TAG}-ubuntu.tar.gz" user-sync
env:
UST_VARIANT_TAG: ${{matrix.variant_tag}}
UST_VERSION: ${{ steps.get_version.outputs.version }}
- name: Make artifacts
uses: actions/upload-artifact@v2
with:
name: user-sync-artifact
path: dist/*.tar.gz
retention-days: 5
windows:
runs-on: windows-latest
strategy:
matrix:
include:
- extension_support: 0
variant_tag: "-noext"
- extension_support: 1
variant_tag: ""
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
with:
python-version: '3.6'
- run: |
pip install external/okta-0.0.3.1-py2.py3-none-any.whl
pip install -e .
pip install -e .[test]
pip install -e .[setup]
- name: Make Standalone
run: |
make standalone
env:
UST_EXTENSION: ${{matrix.extension_support}}
- name: Test with pytest
run: pytest
- name: Get version tag
id: get_version
uses: battila7/get-version-action@v2
- name: zip
run: |
cd dist
7z a user-sync-${UST_VERSION}${UST_VARIANT_TAG}-win64.zip user-sync.exe
env:
UST_VARIANT_TAG: ${{matrix.variant_tag}}
UST_VERSION: ${{ steps.get_version.outputs.version }}
- name: Make artifact
uses: actions/upload-artifact@v2
with:
name: user-sync-artifact
path: dist/*.zip
retention-days: 5
centos:
runs-on: ubuntu-latest
env:
LC_ALL: en_US.utf8
LANG: en_US.utf8
container:
image: centos:7
strategy:
matrix:
include:
- extension_support: 0
variant_tag: "-noext"
- extension_support: 1
variant_tag: ""
steps:
- uses: actions/checkout@v2
- name: Centos-Install dependencies
run: |
yum install -y epel-release
yum install -y https://repo.ius.io/ius-release-el7.rpm
yum install -y https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm
yum install -y gcc make python36u-devel python36u-pip python36u-virtualenv
yum install -y python-devel python-pip python-virtualenv
yum install -y pkgconfig openssl-devel dbus-glib-devel dbus-python libffi-devel
rm -f /usr/bin/python && ln -s /usr/bin/python3 /usr/bin/python
- name: Make Standalone
run: |
pip3 install external/okta-0.0.3.1-py2.py3-none-any.whl
pip3 install -e .
pip3 install -e .[test]
pip3 install -e .[setup]
make standalone
env:
UST_EXTENSION: ${{matrix.extension_support}}
- name: Test with pytest
run: pytest -s
- name: Get version tag
id: get_version
uses: battila7/get-version-action@v2
- name: Get build
run: |
cd dist
tar czf "user-sync-${UST_VERSION}${UST_VARIANT_TAG}-centos.tar.gz" user-sync
env:
UST_VARIANT_TAG: ${{matrix.variant_tag}}
UST_VERSION: ${{ steps.get_version.outputs.version }}
- name: make atrifact
uses: actions/upload-artifact@v2
with:
name: user-sync-artifact
path: dist/*.tar.gz
retention-days: 5
examples:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: user-sync-examples-zip
run: |
cd examples
zip -r user-sync-examples.zip .
- uses: actions/upload-artifact@v2
with:
name: user-sync-artifact
path: examples/*.zip
retention-days: 5
- name: user-sync.tar.gz
run: |
tar -czvf "user-sync-examples.tar.gz" examples
- uses: actions/upload-artifact@v2
with:
name: user-sync-artifact
path: user-sync-examples.tar.gz
retention-days: 5
release:
runs-on: ubuntu-latest
needs: [ubuntu,windows, centos, examples]
steps:
- uses: actions/checkout@v2
- name: Create Release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.ref }}
release_name: user-sync ${{ github.ref }}
body_path: .changelog/latest.md
draft: true
prerelease: false
upload-assets:
needs: release
runs-on: ubuntu-latest
steps:
- uses: actions/download-artifact@v2
- name: Get version tag
id: get_version
uses: battila7/get-version-action@v2
- run: ls -R
- uses: fnkr/github-action-ghr@v1
if: startsWith(github.ref, 'refs/tags/')
env:
GHR_PATH: user-sync-artifact/
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}