-
Notifications
You must be signed in to change notification settings - Fork 0
158 lines (136 loc) · 4.51 KB
/
create-release.yml
File metadata and controls
158 lines (136 loc) · 4.51 KB
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
on:
push:
# Sequence of patterns matched against refs/tags
tags:
- 'v*' # Push events to matching v*, i.e. v1.0, v20.15.10
name: Release
jobs:
build:
name: Build on ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
runs-on: ${{ matrix.os }}
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Install stable toolchain
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: nightly
override: true
- name: Setup python 3.6
uses: actions/setup-python@v2
with:
python-version: 3.6
- name: Setup python 3.7
uses: actions/setup-python@v2
with:
python-version: 3.7
- name: Setup python 3.8
uses: actions/setup-python@v2
with:
python-version: 3.8
- name: Install poetry
uses: abatilo/actions-poetry@v2.0.0
with:
poetry-version: 1.1.4
- name: Install dependencies
run: poetry install
- name: Build wheels
run: poetry run maturin build
- name: Copy binary
if: matrix.os == 'ubuntu-latest'
run: |
mkdir -p ./streamson-linux/
cp target/wheels/*.whl streamson-linux/
tar czf streamson-linux.tar.gz streamson-linux/
mkdir -p ./dist
cp streamson-linux.tar.gz dist/
- name: Copy binary
if: matrix.os == 'windows-latest'
run: |
mkdir ./streamson-windows/
cp target/wheels/*.whl streamson-windows/
Compress-Archive -Path streamson-windows/ -DestinationPath streamson-windows.zip
mkdir ./dist
cp streamson-windows.zip dist/
- name: Copy binary
if: matrix.os == 'macos-latest'
run: |
mkdir -p ./streamson-macos/
cp target/wheels/*.whl streamson-macos/
tar czf streamson-macos.tar.gz streamson-macos/
mkdir -p ./dist
cp streamson-macos.tar.gz dist/
- name: Upload artifacts
uses: actions/upload-artifact@v1
with:
name: ${{ matrix.os }}
path: ./dist
release:
name: Create Release
needs: ['build']
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@master
- name: Download artifacts ubuntu
uses: actions/download-artifact@v1
with:
name: ubuntu-latest
path: dist
- name: Download artifacts windows
uses: actions/download-artifact@v1
with:
name: windows-latest
path: dist
- name: Download artifacts macos
uses: actions/download-artifact@v1
with:
name: macos-latest
path: dist
- name: Get description
run: echo "::set-output name=DESCRIPTION::$(git tag -l --format='%(contents:body)' ${{ github.ref }})"
id: get_description
- name: Create Release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.ref }}
release_name: Release ${{ github.ref }}
body: "${{ steps.get_description.outputs.DESCRIPTION }}"
draft: false
prerelease: false
continue-on-error: true # Already existing release
- name: Upload Release Asset ubuntu
uses: actions/upload-release-asset@v1.0.1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: dist/streamson-linux.tar.gz
asset_name: streamson-linux.tar.gz
asset_content_type: application/tar+gzip
- name: Upload Release Asset windows
uses: actions/upload-release-asset@v1.0.1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: dist/streamson-windows.zip
asset_name: streamson-windows.zip
asset_content_type: application/bin
- name: Upload Release Asset macos
uses: actions/upload-release-asset@v1.0.1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: dist/streamson-macos.tar.gz
asset_name: streamson-macos.tar.gz
asset_content_type: application/tar+gzip