Skip to content

Commit 9d3958f

Browse files
committed
feature: make github releases for macos and windows and different version of python
1 parent 8779c2c commit 9d3958f

1 file changed

Lines changed: 49 additions & 52 deletions

File tree

.github/workflows/create-release.yml

Lines changed: 49 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,11 @@ name: Release
99
jobs:
1010
build:
1111
name: Build on ${{ matrix.os }}
12-
runs-on: ${{ matrix.os }}
1312
strategy:
13+
fail-fast: false
1414
matrix:
15-
os: [ubuntu-latest, macos-latest]
16-
#os: [ubuntu-latest, windows-latest, macos-latest]
17-
15+
os: [ubuntu-latest, windows-latest, macos-latest]
16+
runs-on: ${{ matrix.os }}
1817
steps:
1918
- name: Checkout code
2019
uses: actions/checkout@v2
@@ -29,68 +28,66 @@ jobs:
2928
- name: Setup python 3.6
3029
uses: actions/setup-python@v2
3130
with:
32-
python-version: '3.6'
31+
python-version: 3.6
3332

3433
- name: Setup python 3.7
3534
uses: actions/setup-python@v2
3635
with:
37-
python-version: '3.7'
36+
python-version: 3.7
3837

3938
- name: Setup python 3.8
4039
uses: actions/setup-python@v2
4140
with:
42-
python-version: '3.8'
41+
python-version: 3.8
4342

4443
- name: Install poetry
45-
run: |
46-
curl -sSL https://raw.githubusercontent.com/python-poetry/poetry/master/get-poetry.py | python
44+
uses: abatilo/actions-poetry@v2.0.0
45+
with:
46+
poetry-version: 1.1.4
4747

4848
- name: Install dependencies
49-
run: |
50-
env PATH="${PATH}:${HOME}/.poetry/bin" poetry install
49+
run: poetry install
5150

5251
- name: Build wheels
53-
run: |
54-
env PATH="${PATH}:${HOME}/.poetry/bin" poetry run maturin build
52+
run: poetry run maturin build
5553

5654
- name: Copy binary
5755
if: matrix.os == 'ubuntu-latest'
5856
run: |
59-
mkdir -p ./python-streamson-linux/
60-
cp target/wheels/*.whl python-streamson-linux/
61-
tar czf python-streamson-linux.tar.gz python-streamson-linux
57+
mkdir -p ./streamson-linux/
58+
cp target/wheels/*.whl streamson-linux/
59+
tar czf streamson-linux.tar.gz streamson-linux/
6260
mkdir -p ./dist
63-
cp python-streamson-linux.tar.gz dist/
61+
cp streamson-linux.tar.gz dist/
6462
65-
#- name: Copy binary
66-
# if: matrix.os == 'windows-latest'
67-
# run: |
68-
# mkdir -p ./dist
69-
# cp target/wheel/*.whl dist/
63+
- name: Copy binary
64+
if: matrix.os == 'windows-latest'
65+
run: |
66+
mkdir ./streamson-windows/
67+
cp target/wheels/*.whl streamson-windows/
68+
Compress-Archive -Path streamson-windows/ -DestinationPath streamson-windows.zip
69+
mkdir ./dist
70+
cp streamson-windows.zip dist/
7071
7172
- name: Copy binary
7273
if: matrix.os == 'macos-latest'
7374
run: |
74-
mkdir -p ./python-streamson-macos/
75-
cp target/wheels/*.whl python-streamson-macos/
76-
tar czf python-streamson-macos.tar.gz python-streamson-macos
75+
mkdir -p ./streamson-macos/
76+
cp target/wheels/*.whl streamson-macos/
77+
tar czf streamson-macos.tar.gz streamson-macos/
7778
mkdir -p ./dist
78-
cp python-streamson-macos.tar.gz dist/
79+
cp streamson-macos.tar.gz dist/
7980
8081
- name: Upload artifacts
8182
uses: actions/upload-artifact@v1
8283
with:
8384
name: ${{ matrix.os }}
8485
path: ./dist
8586

86-
- name: List
87-
run: ls -al ./dist
88-
8987
release:
9088
name: Create Release
91-
runs-on: ubuntu-latest
9289
needs: ['build']
93-
90+
runs-on: ubuntu-latest
9491
steps:
9592
- name: Checkout code
9693
uses: actions/checkout@master
@@ -101,11 +98,11 @@ jobs:
10198
name: ubuntu-latest
10299
path: dist
103100

104-
#- name: Download artifacts windows
105-
# uses: actions/download-artifact@v1
106-
# with:
107-
# name: windows-latest
108-
# path: dist
101+
- name: Download artifacts windows
102+
uses: actions/download-artifact@v1
103+
with:
104+
name: windows-latest
105+
path: dist
109106

110107
- name: Download artifacts macos
111108
uses: actions/download-artifact@v1
@@ -114,7 +111,7 @@ jobs:
114111
path: dist
115112

116113
- name: Get description
117-
run: echo "##[set-output name=tag_description;]$(git tag -l --format='%(contents:body)' ${{ github.ref }})"
114+
run: echo "::set-output name=DESCRIPTION::$(git tag -l --format='%(contents:body)' ${{ github.ref }})"
118115
id: get_description
119116

120117
- name: Create Release
@@ -125,37 +122,37 @@ jobs:
125122
with:
126123
tag_name: ${{ github.ref }}
127124
release_name: Release ${{ github.ref }}
128-
body: "${{ steps.get_description.outputs.description }}"
125+
body: "${{ steps.get_description.outputs.DESCRIPTION }}"
129126
draft: false
130127
prerelease: false
128+
continue-on-error: true # Already existing release
131129

132130
- name: Upload Release Asset ubuntu
133131
uses: actions/upload-release-asset@v1.0.1
134132
env:
135133
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
136134
with:
137135
upload_url: ${{ steps.create_release.outputs.upload_url }}
138-
asset_path: dist/python-streamson-linux.tar.gz
139-
asset_name: python-streamson-linux.tar.gz
136+
asset_path: dist/streamson-linux.tar.gz
137+
asset_name: streamson-linux.tar.gz
140138
asset_content_type: application/tar+gzip
141139

142-
143-
#- name: Upload Release Asset windows
144-
# uses: actions/upload-release-asset@v1.0.1
145-
# env:
146-
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
147-
# with:
148-
# upload_url: ${{ steps.create_release.outputs.upload_url }}
149-
# asset_path: dist/ucelofka-windows.exe
150-
# asset_name: ucelofka-windows.exe
151-
# asset_content_type: application/bin
140+
- name: Upload Release Asset windows
141+
uses: actions/upload-release-asset@v1.0.1
142+
env:
143+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
144+
with:
145+
upload_url: ${{ steps.create_release.outputs.upload_url }}
146+
asset_path: dist/streamson-windows.zip
147+
asset_name: streamson-windows.zip
148+
asset_content_type: application/bin
152149

153150
- name: Upload Release Asset macos
154151
uses: actions/upload-release-asset@v1.0.1
155152
env:
156153
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
157154
with:
158155
upload_url: ${{ steps.create_release.outputs.upload_url }}
159-
asset_path: dist/python-streamson-macos.tar.gz
160-
asset_name: python-streamson-macos.tar.gz
156+
asset_path: dist/streamson-macos.tar.gz
157+
asset_name: streamson-macos.tar.gz
161158
asset_content_type: application/tar+gzip

0 commit comments

Comments
 (0)