-
Notifications
You must be signed in to change notification settings - Fork 1
188 lines (179 loc) · 6.11 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
name: Deploy
on:
push:
branches: [ main ]
jobs:
createrelease:
name: createrelease
runs-on: ubuntu-latest
steps:
- name: Check out code
uses: actions/checkout@v1
- name: Get current date
id: date
run: echo "::set-output name=date::$(date +%F)"
- name: create release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ steps.date.outputs.date }}
release_name: Release ${{ steps.date.outputs.date }}
draft: false
prerelease: false
- name: Output Release URL File
run: echo "${{ steps.create_release.outputs.upload_url }}" > release_url.txt
- name: Date File
run: echo "${{ steps.date.outputs.date }}" > date.txt
- name: Save Release URL File for publish
uses: actions/upload-artifact@v1
with:
name: release_url
path: release_url.txt
- name: Save Date File for publish
uses: actions/upload-artifact@v1
with:
name: date
path: date.txt
build_linux:
name: Linux
needs: [createrelease]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: conda-incubator/setup-miniconda@v2
with:
auto-update-conda: true
python-version: "3.11"
- name: Load Release URL File from release job
uses: actions/download-artifact@v1
with:
name: release_url
- name: Load Date File from release job
uses: actions/download-artifact@v1
with:
name: date
- name: Get Release File Name & Upload URL
id: get_release_info
run: |
value=`cat release_url/release_url.txt`
echo ::set-output name=upload_url::$value
- name: Get Release File Name & Upload URL
id: get_date_info
run: |
value=`cat date/date.txt`
echo ::set-output name=date::$value
- name: Build Constructor
shell: bash -l {0}
run: |
conda install -y --name test -c conda-forge constructor
mkdir build
constructor -v --output-dir=build --platform="linux-64" constructor
mv ./build/pyiron-0.0.0-Linux-x86_64.sh ./build/$FILENAME
env:
FILENAME: pyiron-${{ steps.get_date_info.outputs.date }}-Linux-x86_64.sh
- name: Upload Release Asset
id: upload-release-asset
uses: actions/[email protected]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.get_release_info.outputs.upload_url }}
asset_path: ./build/pyiron-${{ steps.get_date_info.outputs.date }}-Linux-x86_64.sh
asset_name: pyiron-${{ steps.get_date_info.outputs.date }}-Linux-x86_64.sh
asset_content_type: application/zip
build_mac:
name: MacOsX
needs: [createrelease]
runs-on: macos-latest
steps:
- uses: actions/checkout@v2
- uses: conda-incubator/setup-miniconda@v2
with:
auto-update-conda: true
python-version: "3.11"
- name: Load Release URL File from release job
uses: actions/download-artifact@v1
with:
name: release_url
- name: Load Date File from release job
uses: actions/download-artifact@v1
with:
name: date
- name: Get Release File Name & Upload URL
id: get_release_info
run: |
value=`cat release_url/release_url.txt`
echo ::set-output name=upload_url::$value
- name: Get Release File Name & Upload URL
id: get_date_info
run: |
value=`cat date/date.txt`
echo ::set-output name=date::$value
- name: Build Constructor
shell: bash -l {0}
run: |
conda install -y --name test -c conda-forge constructor
mkdir build
constructor -v --output-dir=build --platform="osx-64" constructor
mv ./build/pyiron-0.0.0-MacOSX-x86_64.pkg ./build/$FILENAME
env:
FILENAME: pyiron-${{ steps.get_date_info.outputs.date }}-MacOSX-x86_64.pkg
- name: Upload Release Asset
id: upload-release-asset
uses: actions/[email protected]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.get_release_info.outputs.upload_url }}
asset_path: ./build/pyiron-${{ steps.get_date_info.outputs.date }}-MacOSX-x86_64.pkg
asset_name: pyiron-${{ steps.get_date_info.outputs.date }}-MacOSX-x86_64.pkg
asset_content_type: application/zip
build_win:
name: Windows
needs: [createrelease]
runs-on: windows-latest
steps:
- uses: actions/checkout@v2
- uses: conda-incubator/setup-miniconda@v2
with:
auto-update-conda: true
python-version: "3.11"
- name: Load Release URL File from release job
uses: actions/download-artifact@v1
with:
name: release_url
- name: Load Date File from release job
uses: actions/download-artifact@v1
with:
name: date
- name: Get Release File Name & Upload URL
id: get_release_info
run: |
$value = Get-Content release_url/release_url.txt
echo "::set-output name=upload_url::$value"
- name: Get Release File Name & Upload URL
id: get_date_info
run: |
$value = Get-Content date/date.txt
echo "::set-output name=date::$value"
- name: Build Constructor
shell: bash -l {0}
run: |
conda install -y --name test -c conda-forge constructor
mkdir build
constructor -v --output-dir=build --platform="win-64" constructor
mv ./build/pyiron-0.0.0-Windows-x86_64.exe ./build/$FILENAME
env:
FILENAME: pyiron-${{ steps.get_date_info.outputs.date }}-Windows-x86_64.exe
- name: Upload Release Asset
id: upload-release-asset
uses: actions/[email protected]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.get_release_info.outputs.upload_url }}
asset_path: ./build/pyiron-${{ steps.get_date_info.outputs.date }}-Windows-x86_64.exe
asset_name: pyiron-${{ steps.get_date_info.outputs.date }}-Windows-x86_64.exe
asset_content_type: application/zip