-
Notifications
You must be signed in to change notification settings - Fork 0
102 lines (86 loc) · 3.02 KB
/
build_and_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
name: CurveFinder build and release
on: [push]
jobs:
build:
strategy:
matrix:
os: [windows-latest, ubuntu-latest, macos-latest]
fail-fast: false
runs-on: ${{ matrix.os }}
steps:
- name: Checkout the repository
uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: '3.9'
cache: 'pip'
- name: Install dependencies
run: pip install -r requirements.txt
- name: Build the executable
run: python build.py -b
- name: Upload executable for Windows
if: ${{ runner.os == 'Windows' }}
uses: actions/upload-artifact@v2
with:
name: bin
path: './dist/CurveFinder_v*.*_win.exe'
- name: Upload executable for Linux
if: ${{ runner.os == 'Linux' }}
uses: actions/upload-artifact@v2
with:
name: bin
path: './dist/CurveFinder_v*.*_linux'
- name: Upload executable for Mac
if: ${{ runner.os == 'macOS' }}
uses: actions/upload-artifact@v2
with:
name: bin
path: './dist/CurveFinder_v*.*_macos'
release:
needs: build
runs-on: ubuntu-latest
if: startsWith(github.ref, 'refs/tags/v')
steps:
- name: Creating the release
id: create_release
uses: actions/create-release@v1
with:
draft: false
prerelease: false
release_name: CurveFinder ${{ github.ref_name }}
tag_name: ${{ github.ref }}
body: The changes for ${{ github.ref_name }} are listed in the [changelog](./CHANGELOG.md).
env:
GITHUB_TOKEN: ${{ github.token }}
- name: Download the artifacts
uses: actions/download-artifact@v2
with:
name: bin
- name: Upload the release asset for Windows
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ github.token }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: CurveFinder_${{ github.ref_name }}_win.exe
asset_name: CurveFinder_${{ github.ref_name }}_win.exe
asset_content_type: application/exe
- name: Upload the release asset for Linux
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ github.token }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: CurveFinder_${{ github.ref_name }}_linux
asset_name: CurveFinder_${{ github.ref_name }}_linux
asset_content_type: application/octet-stream
- name: Upload the release asset for MacOS
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ github.token }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: CurveFinder_${{ github.ref_name }}_macos
asset_name: CurveFinder_${{ github.ref_name }}_macos
asset_content_type: application/octet-stream