-
Notifications
You must be signed in to change notification settings - Fork 0
145 lines (139 loc) · 5.7 KB
/
Copy pathrust.yml
File metadata and controls
145 lines (139 loc) · 5.7 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
# GitHub Actions
# SPDX-License-Identifier: MIT
# Copyright (C) 2020 Benjamin Schilling
name: Rust
on: push
env:
CARGO_TERM_COLOR: always
jobs:
build-linux:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set-up toolchain
uses: actions-rs/toolchain@v1
with:
toolchain: nightly
override: true
components: rustfmt, clippy
- name: linter
uses: actions-rs/clippy-check@v1
with:
token: ${{ secrets.GITHUB_TOKEN }}
args: --all-features
- name: Build
run: cargo build --release
#- name: Run tests
# run: cargo test --release -- --test-threads=1
- uses: actions/upload-artifact@v1
with:
name: kvsd-linux-amd64
path: ./target/release/kvsd
- uses: actions/upload-artifact@v1
with:
name: kvsc-linux-amd64
path: ./target/release/kvsc
- name: Prepare Debian build
run: |
sudo apt-get update
sudo apt-get install debhelper
mkdir -p debian-packaging
rsync -av --exclude='debian-packaging' . debian-packaging/
- name: Build Debian Package
run: |
cd debian-packaging
dpkg-buildpackage -uc -us
- uses: actions/upload-artifact@v1
with:
name: kvs_0.1.0-0_amd64.deb
path: ./kvs_0.1.0-0_amd64.deb
build-windows:
runs-on: windows-latest
steps:
- uses: actions/checkout@v2
- name: Set-up toolchain
uses: actions-rs/toolchain@v1
with:
toolchain: nightly
override: true
components: rustfmt
- name: Build exe
run: |
cargo build --release
- name: Run tests
run: cargo test --release -- --test-threads=1
- uses: actions/upload-artifact@v1
with:
name: kvsd.exe
path: ./target/release/kvsd.exe
- uses: actions/upload-artifact@v1
with:
name: kvsc.exe
path: ./target/release/kvsc.exe
release:
runs-on: ubuntu-latest
needs: [build-windows, build-linux]
if: contains(github.ref, 'refs/tags/')
steps:
- name: Create a Release
uses: actions/create-release@v1
id: create_release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # This token is provided by Actions, you do not need to create your own token
with:
tag_name: ${{ github.ref }}
release_name: Release ${{ github.ref }}
draft: false
prerelease: true
- name: Download all workflow run artifacts
uses: actions/download-artifact@v2
- name: Upload Release Asset Windows - kvsd
id: upload-release-asset-windows-kvsd
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }} # This pulls from the CREATE RELEASE step above, referencing it's ID to get its outputs object, which include a `upload_url`. See this blog post for more info: https://jasonet.co/posts/new-features-of-github-actions/#passing-data-to-future-steps
asset_path: ./kvsd.exe/kvsd.exe
asset_name: kvsd.exe
asset_content_type: application/octet-stream
- name: Upload Release Asset Windows - kvsc
id: upload-release-asset-windows-kvsc
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }} # This pulls from the CREATE RELEASE step above, referencing it's ID to get its outputs object, which include a `upload_url`. See this blog post for more info: https://jasonet.co/posts/new-features-of-github-actions/#passing-data-to-future-steps
asset_path: ./kvsc.exe/kvsc.exe
asset_name: kvsc.exe
asset_content_type: application/octet-stream
- name: Upload Release Asset Linux - kvsd
id: upload-release-asset-linux-kvsd
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }} # This pulls from the CREATE RELEASE step above, referencing it's ID to get its outputs object, which include a `upload_url`. See this blog post for more info: https://jasonet.co/posts/new-features-of-github-actions/#passing-data-to-future-steps
asset_path: ./kvsd-linux-amd64/kvsd
asset_name: kvsd-linux-amd64
asset_content_type: application/octet-stream
- name: Upload Release Asset Linux - kvsc
id: upload-release-asset-linux-kvsc
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }} # This pulls from the CREATE RELEASE step above, referencing it's ID to get its outputs object, which include a `upload_url`. See this blog post for more info: https://jasonet.co/posts/new-features-of-github-actions/#passing-data-to-future-steps
asset_path: ./kvsc-linux-amd64/kvsc
asset_name: kvsc-linux-amd64
asset_content_type: application/octet-stream
- name: Upload Release Asset Linux - debian
id: upload-release-asset-linux-debian
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }} # This pulls from the CREATE RELEASE step above, referencing it's ID to get its outputs object, which include a `upload_url`. See this blog post for more info: https://jasonet.co/posts/new-features-of-github-actions/#passing-data-to-future-steps
asset_path: ./kvs_0.1.0-0_amd64.deb/kvs_0.1.0-0_amd64.deb
asset_name: kvs_0.1.0-0_amd64.deb
asset_content_type: application/octet-stream