Skip to content

Commit 38fa256

Browse files
Merge #607
607: ci: add action to build and release binaries r=burrbull a=duskmoon314 - Execute when new commit in master and attach to pre-release - Execute when new version tag and attach to release - Allow manual execution close #597 Co-authored-by: Campbell He <[email protected]>
2 parents f63d5cd + 8992644 commit 38fa256

File tree

2 files changed

+73
-0
lines changed

2 files changed

+73
-0
lines changed

.github/workflows/release.yml

Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
name: release
2+
on:
3+
push:
4+
branches:
5+
- master
6+
tags:
7+
- v*.*.*
8+
workflow_dispatch:
9+
10+
jobs:
11+
build:
12+
strategy:
13+
matrix:
14+
include:
15+
- os: ubuntu-latest
16+
target: x86_64-unknown-linux-gnu
17+
suffix: ""
18+
- os: macos-latest
19+
target: x86_64-apple-darwin
20+
suffix: ""
21+
- os: macos-latest
22+
target: aarch64-apple-darwin
23+
suffix: ""
24+
- os: windows-latest
25+
target: x86_64-pc-windows-msvc
26+
suffix: ".exe"
27+
runs-on: ${{ matrix.os }}
28+
steps:
29+
- uses: actions/checkout@v3
30+
- uses: actions-rs/toolchain@v1
31+
with:
32+
toolchain: stable
33+
profile: minimal
34+
target: ${{ matrix.target }}
35+
override: true
36+
- name: Cache Dependencies
37+
uses: Swatinem/rust-cache@v1
38+
with:
39+
key: ${{ matrix.target }}
40+
- uses: actions-rs/cargo@v1
41+
with:
42+
command: build
43+
args: --target ${{ matrix.target }} --release
44+
- name: Rename executable
45+
run: mv target/${{ matrix.target }}/release/svd2rust${{ matrix.suffix }} target/${{ matrix.target }}/release/svd2rust-${{ matrix.target }}${{ matrix.suffix }}
46+
- uses: actions/upload-artifact@v3
47+
with:
48+
name: svd2rust-${{ matrix.target }}
49+
path: target/${{ matrix.target }}/release/svd2rust-${{ matrix.target }}${{ matrix.suffix }}
50+
51+
release:
52+
name: release
53+
runs-on: ubuntu-latest
54+
needs: [build]
55+
steps:
56+
- uses: actions/download-artifact@v3
57+
with:
58+
path: artifacts
59+
- run: ls -R ./artifacts
60+
- uses: softprops/action-gh-release@v1
61+
if: ${{ !startsWith(github.ref, 'refs/tags/v') }}
62+
with:
63+
prerelease: true
64+
name: "Pre-release"
65+
tag_name: "pre-release"
66+
files: |
67+
artifacts/**/*
68+
- uses: softprops/action-gh-release@v1
69+
if: startsWith(github.ref, 'refs/tags/v')
70+
with:
71+
files: |
72+
artifacts/**/*

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
1111
- Use generic `FieldWriter`, `FieldReader`, `BitWriter`, `BitReader`
1212
- Disable two clippy warnings in `array_proxy.rs`
1313
- Add comments in docs about `readAction`
14+
- Add CI to build and release binaries
1415

1516
## [v0.23.1] - 2022-04-29
1617

0 commit comments

Comments
 (0)