Compile Release #3
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Compile Release | |
on: | |
release: | |
types: [created] | |
workflow_dispatch: | |
env: | |
CARGO_TERM_COLOR: always | |
jobs: | |
build-linux: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Build | |
run: cargo build --release | |
- name: Create Release Zip | |
run: zip -j yamlvd_linux_x64.zip target/release/yamlvd | |
- name: Upload Zip | |
uses: actions/upload-artifact@v3 | |
with: | |
name: yamlvd_linux | |
path: yamlvd_linux_x64.zip | |
- name: Release | |
uses: softprops/action-gh-release@v1 | |
if: startsWith(github.ref, 'refs/tags/') | |
with: | |
files: yamlvd_linux_x64.zip | |
env: | |
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}} | |
build-windows: | |
runs-on: windows-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Build | |
run: cargo build --release | |
- name: Create Release Zip | |
run: | | |
cd target/release | |
Compress-Archive -path yamlvd.exe -destinationPath yamlvd_win_x64.zip | |
cd ../.. | |
- name: Upload Zip | |
uses: actions/upload-artifact@v3 | |
with: | |
name: yamlvd_win | |
path: target/release/yamlvd_win_x64.zip | |
- name: Release | |
uses: softprops/action-gh-release@v1 | |
if: startsWith(github.ref, 'refs/tags/') | |
with: | |
files: target/release/yamlvd_win_x64.zip | |
env: | |
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}} | |
build-macos: | |
runs-on: macos-latest | |
strategy: | |
matrix: | |
target: [x86_64-apple-darwin] | |
desc: [intel] | |
include: | |
- target: aarch64-apple-darwin | |
desc: apple_silicon | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Install Rust Toolchain | |
uses: actions-rs/toolchain@v1 | |
with: | |
toolchain: stable | |
target: ${{matrix.target}} | |
- name: Build | |
run: cargo build --release --target ${{matrix.target}} | |
- name: Sign Binaries | |
run: codesign -s - target/${{matrix.target}}/release/yamlvd | |
- name: Create Release Zip | |
run: | | |
cd target/${{matrix.target}}/release | |
zip yamlvd_macos_${{matrix.desc}}.zip yamlvd | |
cd ../../.. | |
- name: Upload Zip | |
uses: actions/upload-artifact@v3 | |
with: | |
name: yamlvd_macos_${{matrix.desc}} | |
path: target/${{matrix.target}}/release/yamlvd_macos_${{matrix.desc}}.zip | |
- name: Release | |
uses: softprops/action-gh-release@v1 | |
if: startsWith(github.ref, 'refs/tags/') | |
with: | |
files: target/${{matrix.target}}/release/yamlvd_macos_${{matrix.desc}}.zip | |
env: | |
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}} |