Skip to content

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

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

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

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:
targets: "${{ env.TARGET }}"
- name: Setup Cache
uses: Swatinem/rust-cache@v2
- name: Create empty .env file
run: touch .env
- name: Build binary
uses: houseabsolute/actions-rust-cross@v0
with:
command: "build"
target: "${{ env.TARGET }}"
toolchain: "stable"
args: "--locked --release"
# Zip the binary
- name: Generate zip
run: |
cd target/${{ env.TARGET }}/release
7z a ../../${{ env.FILENAME }}.zip tagoio-relay.exe
# 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