Skip to content

Commit a3a5fe4

Browse files
authored
Add build matrix, release jobs & licence. (#2)
* Add testing on macos. * Add windows build. * Add caching to test build. * Add other release targets. * Use draft releases * Fix release settings. * Add MIT license.
1 parent acaf002 commit a3a5fe4

File tree

2 files changed

+92
-2
lines changed

2 files changed

+92
-2
lines changed

.github/workflows/build.yaml

Lines changed: 71 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,19 @@ jobs:
1919

2020
test:
2121
name: Test Suite
22-
runs-on: ubuntu-latest
22+
strategy:
23+
matrix:
24+
os: [ubuntu-latest, macos-latest, windows-latest]
25+
runs-on: ${{ matrix.os }}
2326
steps:
2427
- uses: actions/checkout@v2
28+
- uses: actions/cache@v1
29+
with:
30+
path: ~/.cargo
31+
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.toml') }}-${{ hashFiles('**/Cargo.lock') }}
32+
restore-keys: |
33+
${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.toml') }}
34+
${{ runner.os }}-cargo
2535
- uses: actions-rs/toolchain@v1
2636
with:
2737
profile: minimal
@@ -67,7 +77,7 @@ jobs:
6777
release-linux:
6878
if: startsWith(github.ref, 'refs/tags/')
6979
needs: [check, test, fmt, clippy]
70-
name: Release Build
80+
name: Release Linux
7181
runs-on: ubuntu-latest
7282
steps:
7383
- uses: actions/checkout@v2
@@ -89,5 +99,64 @@ jobs:
8999
with:
90100
files: |
91101
target/release/scry_amd64
102+
draft: true
103+
env:
104+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
105+
106+
release-macos:
107+
if: startsWith(github.ref, 'refs/tags/')
108+
needs: [check, test, fmt, clippy]
109+
name: Release MacOS
110+
runs-on: macos-latest
111+
steps:
112+
- uses: actions/checkout@v2
113+
- uses: actions-rs/toolchain@v1
114+
with:
115+
profile: minimal
116+
toolchain: stable
117+
override: true
118+
- uses: actions-rs/cargo@v1
119+
with:
120+
command: test
121+
args: --release
122+
- uses: actions-rs/cargo@v1
123+
with:
124+
command: build
125+
args: --all --release
126+
- run: strip target/release/scry && mv target/release/scry target/release/scry_darwin
127+
- uses: softprops/action-gh-release@v1
128+
with:
129+
files: |
130+
target/release/scry_darwin
131+
draft: true
132+
env:
133+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
134+
135+
release-windows:
136+
if: startsWith(github.ref, 'refs/tags/')
137+
needs: [check, test, fmt, clippy]
138+
name: Release Windows
139+
runs-on: macos-latest
140+
steps:
141+
- uses: actions/checkout@v2
142+
- uses: actions-rs/toolchain@v1
143+
with:
144+
profile: minimal
145+
toolchain: stable
146+
override: true
147+
- uses: actions-rs/cargo@v1
148+
with:
149+
command: test
150+
args: --release
151+
- uses: actions-rs/cargo@v1
152+
with:
153+
command: build
154+
args: --all --release
155+
- run: strip target/release/scry && mv target/release/scry target/release/scry.exe
156+
- uses: softprops/action-gh-release@v1
157+
with:
158+
files: |
159+
target/release/scry.exe
160+
draft: true
92161
env:
93162
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

LICENSE.txt

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2021 Greg Hawkins
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

0 commit comments

Comments
 (0)