forked from aws-cloudformation/cloudformation-guard
-
Notifications
You must be signed in to change notification settings - Fork 1
50 lines (49 loc) · 1.76 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
name: Rust
on:
release:
types: [ published ]
env:
CARGO_TERM_COLOR: always
jobs:
build:
strategy:
matrix:
os: [ubuntu-latest, macos-latest]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v2
- name: Build
run: cargo build --verbose --release
- name: Get release
id: get_release
uses: bruceadams/[email protected]
env:
GITHUB_TOKEN: ${{ github.token }}
- name: Package release
id: package
uses: knicknic/[email protected]
with:
macos: |
rustup target add x86_64-apple-darwin
cargo build --release --target x86_64-apple-darwin
mkdir cfn-guard-v2-${{ matrix.os }}
cp ./target/x86_64-apple-darwin/release/cfn-guard ./cfn-guard-v2-${{ matrix.os }}/
cp README.md ./cfn-guard-v2-${{ matrix.os }}/
tar czvf ./cfn-guard-v2-${{ matrix.os }}.tar.gz ./cfn-guard-v2-${{ matrix.os }}
linux: |
rustup target add x86_64-unknown-linux-musl
cargo build --release --target x86_64-unknown-linux-musl
mkdir cfn-guard-v2-${{ matrix.os }}
cp ./target/x86_64-unknown-linux-musl/release/cfn-guard ./cfn-guard-v2-${{ matrix.os }}/
cp README.md ./cfn-guard-v2-${{ matrix.os }}/
tar czvf ./cfn-guard-v2-${{ matrix.os }}.tar.gz ./cfn-guard-v2-${{ matrix.os }}
- name: Upload Release Asset
id: upload-release-asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.get_release.outputs.upload_url }}
asset_path: ./cfn-guard-v2-${{ matrix.os }}.tar.gz
asset_name: cfn-guard-v2-${{ matrix.os }}.tar.gz
asset_content_type: application/octet-stream