Picocrypt/.github/workflows/build-windows.yml
2024-06-17 23:47:31 -04:00

56 lines
1.3 KiB
YAML

name: build-windows
on:
push:
paths:
- "src/*.go"
- "src/go.mod"
- "src/go.sum"
workflow_dispatch:
jobs:
build:
runs-on: windows-latest
steps:
- uses: actions/checkout@v4
- name: Setup Go
uses: actions/setup-go@v5
with:
go-version: '>=1.22'
check-latest: true
cache: false
- name: Install dependencies
run: |
cd src
go mod download
- name: Build
run: |
cd src
go build -ldflags="-s -w -H=windowsgui -extldflags=-static" Picocrypt.go
env:
CGO_ENABLED: 1
# - name: Add icon and manifest
# shell: pwsh
# run: |
# Invoke-WebRequest https://www.angusj.com/resourcehacker/reshacker_setup.exe
# reshacker_setup.exe /SILENT
# rh
- name: Compress with upx
shell: pwsh
run: |
Invoke-WebRequest https://github.com/upx/upx/releases/download/v4.2.4/upx-4.2.4-win64.zip -OutFile upx.zip
Expand-Archive upx.zip -DestinationPath upx
upx/upx-4.2.4-win64/upx.exe --lzma --brute src/Picocrypt.exe
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: build-windows
path: src/Picocrypt.exe
if-no-files-found: error
compression-level: 9