Skip to content

Commit 7ec8f6d

Browse files
akshayraneAkshay Rane
andauthored
Added OS-specific cargo targets to release workflow (aws-cloudformation#310)
* Added build targets to release workflow * Added build targets to release workflow * Moved TARGETS env variable * Removed JSON variable * Added OS-specific runs * Removed external dependency * Added braces to target in path * Reverting to OS-specific runs * Fixed indent Co-authored-by: Akshay Rane <raneaks@amazon.com>
1 parent 678828b commit 7ec8f6d

File tree

1 file changed

+16
-7
lines changed

1 file changed

+16
-7
lines changed

.github/workflows/release.yml

Lines changed: 16 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -22,13 +22,22 @@ jobs:
2222
GITHUB_TOKEN: ${{ github.token }}
2323
- name: Package release
2424
id: package
25-
run: |
26-
mkdir cfn-guard-v2-${{ matrix.os }}
27-
cp ./target/release/cfn-guard ./cfn-guard-v2-${{ matrix.os }}/
28-
test -e ./target/release/*.so && cp ./target/release/*.so ./cfn-guard-v2-${{ matrix.os }}/
29-
test -e ./target/release/*.dylib && cp ./target/release/*.dylib ./cfn-guard-v2-${{ matrix.os }}/
30-
cp README.md ./cfn-guard-v2-${{ matrix.os }}/
31-
tar czvf ./cfn-guard-v2-${{ matrix.os }}.tar.gz ./cfn-guard-v2-${{ matrix.os }}
25+
uses: knicknic/os-specific-run@v1.0.3
26+
with:
27+
macos: |
28+
rustup target add x86_64-apple-darwin
29+
cargo build --release --target x86_64-apple-darwin
30+
mkdir cfn-guard-v2-${{ matrix.os }}
31+
cp ./target/x86_64-apple-darwin/release/cfn-guard ./cfn-guard-v2-${{ matrix.os }}/
32+
cp README.md ./cfn-guard-v2-${{ matrix.os }}/
33+
tar czvf ./cfn-guard-v2-${{ matrix.os }}.tar.gz ./cfn-guard-v2-${{ matrix.os }}
34+
linux: |
35+
rustup target add x86_64-unknown-linux-musl
36+
cargo build --release --target x86_64-unknown-linux-musl
37+
mkdir cfn-guard-v2-${{ matrix.os }}
38+
cp ./target/x86_64-unknown-linux-musl/release/cfn-guard ./cfn-guard-v2-${{ matrix.os }}/
39+
cp README.md ./cfn-guard-v2-${{ matrix.os }}/
40+
tar czvf ./cfn-guard-v2-${{ matrix.os }}.tar.gz ./cfn-guard-v2-${{ matrix.os }}
3241
- name: Upload Release Asset
3342
id: upload-release-asset
3443
uses: actions/upload-release-asset@v1

0 commit comments

Comments
 (0)