Skip to content

Build cross for win-x64 #1

Build cross for win-x64

Build cross for win-x64 #1

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: ubuntu-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
- name: Install Cross
shell: bash
run: |
curl -L --proto '=https' --tlsv1.2 -sSf https://raw.githubusercontent.com/cargo-bins/cargo-binstall/main/install-from-binstall-release.sh | bash
cargo binstall --no-confirm 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