Build wikilite #1
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Build wikilite | |
on: | |
release: | |
types: [published] | |
jobs: | |
build-macos-amd64: | |
name: Build for MacOS AMD64 | |
runs-on: macos-13 | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v3 | |
- name: Set up Go | |
uses: actions/setup-go@v4 | |
with: | |
go-version: '1.23.4' | |
- name: Set up CGO environment | |
run: | | |
export CC=clang | |
export CGO_ENABLED=1 | |
export GOOS=darwin | |
export GOARCH=amd64 | |
- name: Build wikilite for MacOS AMD64 | |
run: go build -tags=fts5 -ldflags="-s -w" -o wikilite-macos-amd64 . | |
- name: Compress artifact | |
run: tar -czvf wikilite-macos-amd64.tar.gz wikilite-macos-amd64 | |
- name: Upload release asset | |
uses: actions/upload-release-asset@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
upload_url: ${{ github.event.release.upload_url }} | |
asset_path: wikilite-macos-amd64.tar.gz | |
asset_name: wikilite-macos-amd64.tar.gz | |
asset_content_type: application/octet-stream | |
build-macos-arm64: | |
name: Build for MacOS ARM64 | |
runs-on: macos-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v3 | |
- name: Set up Go | |
uses: actions/setup-go@v4 | |
with: | |
go-version: '1.23.4' | |
- name: Set up CGO environment | |
run: | | |
export CC=clang | |
export CGO_ENABLED=1 | |
export GOOS=darwin | |
export GOARCH=arm64 | |
- name: Build wikilite for MacOS ARM64 | |
run: go build -tags=fts5 -ldflags="-s -w" -o wikilite-macos-arm64 . | |
- name: Compress artifact | |
run: tar -czvf wikilite-macos-arm64.tar.gz wikilite-macos-arm64 | |
- name: Upload release asset | |
uses: actions/upload-release-asset@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
upload_url: ${{ github.event.release.upload_url }} | |
asset_path: wikilite-macos-arm64.tar.gz | |
asset_name: wikilite-macos-arm64.tar.gz | |
asset_content_type: application/octet-stream | |
build-linux-amd64: | |
name: Build for Linux AMD64 | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v3 | |
- name: Set up Go | |
uses: actions/setup-go@v4 | |
with: | |
go-version: '1.23.4' | |
- name: Install dependencies | |
run: sudo apt-get update && sudo apt-get install -y gcc | |
- name: Set up CGO environment | |
run: | | |
export CC=gcc | |
export CGO_ENABLED=1 | |
export GOOS=linux | |
export GOARCH=amd64 | |
- name: Build wikilite for Linux AMD64 | |
run: go build -tags=fts5 -ldflags="-s -w -extldflags '-static'" -o wikilite-linux-amd64 . | |
- name: Compress artifact | |
run: tar -czvf wikilite-linux-amd64.tar.gz wikilite-linux-amd64 | |
- name: Upload release asset | |
uses: actions/upload-release-asset@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
upload_url: ${{ github.event.release.upload_url }} | |
asset_path: wikilite-linux-amd64.tar.gz | |
asset_name: wikilite-linux-amd64.tar.gz | |
asset_content_type: application/octet-stream | |
build-linux-arm64: | |
name: Build for Linux ARM64 | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v3 | |
- name: Set up Go | |
uses: actions/setup-go@v4 | |
with: | |
go-version: '1.23.4' | |
- name: Install dependencies | |
run: sudo apt-get update && sudo apt-get install -y gcc-aarch64-linux-gnu | |
- name: Set up CGO environment | |
run: | | |
export CC=aarch64-linux-gnu-gcc | |
export CGO_ENABLED=1 | |
export GOOS=linux | |
export GOARCH=arm64 | |
- name: Build wikilite for Linux ARM64 | |
run: go build -tags=fts5 -ldflags="-s -w -extldflags '-static'" -o wikilite-linux-arm64 . | |
- name: Compress artifact | |
run: tar -czvf wikilite-linux-arm64.tar.gz wikilite-linux-arm64 | |
- name: Upload release asset | |
uses: actions/upload-release-asset@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
upload_url: ${{ github.event.release.upload_url }} | |
asset_path: wikilite-linux-arm64.tar.gz | |
asset_name: wikilite-linux-arm64.tar.gz | |
asset_content_type: application/octet-stream | |
build-windows-amd64: | |
name: Build for Windows AMD64 | |
runs-on: windows-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v3 | |
- name: Set up Go | |
uses: actions/setup-go@v4 | |
with: | |
go-version: '1.23.4' | |
- name: Install dependencies | |
run: choco install mingw -y | |
- name: Set up CGO environment | |
run: | | |
$env:CC = "x86_64-w64-mingw32-gcc" | |
$env:CGO_ENABLED = "1" | |
$env:GOOS = "windows" | |
$env:GOARCH = "amd64" | |
- name: Build wikilite for Windows AMD64 | |
run: go build -tags=fts5 -ldflags="-s -w" -o wikilite-windows-amd64.exe . | |
- name: Compress artifact | |
run: Compress-Archive -Path wikilite-windows-amd64.exe -DestinationPath wikilite-windows-amd64.zip | |
- name: Upload release asset | |
uses: actions/upload-release-asset@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
upload_url: ${{ github.event.release.upload_url }} | |
asset_path: wikilite-windows-amd64.zip | |
asset_name: wikilite-windows-amd64.zip | |
asset_content_type: application/octet-stream | |
build-windows-arm64: | |
name: Build for Windows ARM64 | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v3 | |
- name: Set up Go | |
uses: actions/setup-go@v4 | |
with: | |
go-version: '1.23.4' | |
- name: Install dependencies for Windows ARM64 cross-compilation | |
run: | | |
sudo apt-get update | |
sudo apt-get install -y gcc-mingw-w64 | |
- name: Set up CGO environment for Windows ARM64 | |
run: | | |
export CC=aarch64-w64-mingw32-gcc | |
export CGO_ENABLED=1 | |
export GOOS=windows | |
export GOARCH=arm64 | |
- name: Build wikilite for Windows ARM64 | |
run: go build -tags=fts5 -ldflags="-s -w" -o wikilite-windows-arm64.exe . | |
- name: Compress artifact | |
run: zip wikilite-windows-arm64.zip wikilite-windows-arm64.exe | |
- name: Upload release asset | |
uses: actions/upload-release-asset@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
upload_url: ${{ github.event.release.upload_url }} | |
asset_path: wikilite-windows-arm64.zip | |
asset_name: wikilite-windows-arm64.zip | |
asset_content_type: application/octet-stream |