-
Notifications
You must be signed in to change notification settings - Fork 20
100 lines (98 loc) · 2.96 KB
/
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
name: Release
on:
push:
tags:
- "*"
jobs:
linux:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions-rs/toolchain@v1
with:
toolchain: stable
default: true
- run: cargo build --release -j`nproc`
- uses: actions/upload-artifact@v1
with:
name: linux-artifact
path: target/release/nomino
macos:
runs-on: macos-latest
steps:
- uses: actions/checkout@v3
- uses: actions-rs/toolchain@v1
with:
toolchain: stable
default: true
- run: cargo build --release -j`sysctl -n hw.physicalcpu`
- uses: actions/upload-artifact@v1
with:
name: macos-artifact
path: target/release/nomino
windows:
runs-on: windows-latest
steps:
- uses: actions/checkout@v3
- uses: actions-rs/toolchain@v1
with:
toolchain: stable
default: true
- run: cargo build --release
- uses: actions/upload-artifact@v1
with:
name: windows-artifact
path: target\release\nomino.exe
deploy:
needs: [linux, macos, windows]
runs-on: ubuntu-latest
steps:
- name: Create release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.ref }}
release_name: v${{ github.ref }}
draft: false
prerelease: false
- name: Download linux artifact
uses: actions/download-artifact@v1
with:
name: linux-artifact
- name: Upload linux artifact
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: linux-artifact/nomino
asset_name: nomino-linux-64bit
asset_content_type: application/octet-stream
- name: Download macos artifact
uses: actions/download-artifact@v1
with:
name: macos-artifact
- name: Upload macos artifact
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: macos-artifact/nomino
asset_name: nomino-macos-64bit
asset_content_type: application/octet-stream
- name: Download windows artifact
uses: actions/download-artifact@v1
with:
name: windows-artifact
- name: Upload windows artifact
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: windows-artifact/nomino.exe
asset_name: nomino-windows-64bit.exe
asset_content_type: application/octet-stream