Skip to content

.github/workflows/build-win-x64.yml #12

.github/workflows/build-win-x64.yml

.github/workflows/build-win-x64.yml #12

Workflow file for this run

name: Build for win-x64
on: workflow_dispatch
env:
CARGO_TERM_COLOR: always
TARGET: x86_64-pc-windows-msvc
FILENAME: tagoio-relay-win-x64
jobs:
build:
runs-on: windows-latest
environment: PROD
env:
SERVER_SSL_CA: ${{ secrets.SERVER_SSL_CA }}
SERVER_SSL_CERT: ${{ secrets.SERVER_SSL_CERT }}
SERVER_SSL_KEY: ${{ secrets.SERVER_SSL_KEY }}
steps:
# Checkout the code
- name: Checkout code
uses: actions/checkout@v4
- name: Install Rust toolchain and components
uses: dtolnay/rust-toolchain@stable
with:
target: ${{ env.TARGET }}
- name: Setup Cache
uses: Swatinem/rust-cache@v2
- name: Create empty .env file
run: touch .env
# Install vcpkg
- run: echo "VCPKG_ROOT=$env:VCPKG_INSTALLATION_ROOT" | Out-File -FilePath $env:GITHUB_ENV -Append
- uses: ilammy/setup-nasm@v1
# - run: choco install openssl --no-progress
# Build the modules
- name: Build Binary
run: cargo build --verbose --locked --release --target ${{ env.TARGET }}
# Run tests
- name: Run tests
run: cargo test --verbose
# Zip the binary
- name: Generate zip
run: |
cd target/${{ env.TARGET }}/release
Compress-Archive -Path tagoio-relay.exe -DestinationPath ../../${{ env.FILENAME }}.zip
# Upload the zip file as an artifact
- name: Upload artifact
uses: actions/upload-artifact@v3
with:
name: ${{ env.FILENAME }}
path: ./${{ env.FILENAME }}.zip
# Upload the artifact to the release
# - name: Upload to Release
# uses: actions/upload-release-asset@v1
# with:
# upload_url: ${{ github.event.release.upload_url }}
# asset_path: ./${{ env.FILENAME }}.zip
# asset_name: ${{ env.FILENAME }}.zip
# asset_content_type: application/zip