Skip to content

Build cross for win-x64 #4

Build cross for win-x64

Build cross for win-x64 #4

name: Build cross 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:
targets: "${{ env.TARGET }}"
- name: Setup Cache
uses: Swatinem/rust-cache@v2
- name: Create empty .env file
run: New-Item -ItemType File -Path .env
- name: Install Cross
run: cargo install cross
# Build the modules
- name: Build Binary
run: cross build --verbose --locked --release --target ${{ env.TARGET }}
# 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