Skip to content

[pull] master from ghostunnel:master #218

[pull] master from ghostunnel:master

[pull] master from ghostunnel:master #218

Workflow file for this run

---
name: Compile
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
workflow_dispatch:
permissions:
contents: read
jobs:
build-docker:
name: Build (Docker)
runs-on: ubuntu-24.04
steps:
- name: Checkout
uses: actions/checkout@v6
with:
fetch-depth: 0
- name: Set up buildx command
id: buildx
uses: docker/setup-buildx-action@v4
with:
install: true
- name: Set up Go
uses: actions/setup-go@v6
with:
go-version: '1.26.x'
cache: false
- name: Build containers
run: go tool mage -v docker:build
env:
GITHUB_REF: ${{ github.ref }}
build-linux:
name: Build (Linux)
strategy:
matrix:
version: [1.26.x]
os: [ubuntu-22.04, ubuntu-24.04]
runs-on: ${{ matrix.os }}
steps:
- name: Set up cross toolchain
run: |
sudo apt-get update
sudo apt-get install -y gcc-aarch64-linux-gnu
- name: Set up toolchain
uses: actions/setup-go@v6
with:
go-version: ${{ matrix.version }}
cache: false
id: go
- name: Checkout
uses: actions/checkout@v6
with:
fetch-depth: 100
fetch-tags: true
- name: Build binary
run: |
go tool mage -compile ./mage-bin
CGO_ENABLED=1 GOARCH=amd64 ./mage-bin -v go:build
mv ghostunnel ghostunnel-linux-amd64
CGO_ENABLED=1 GOARCH=arm64 CC=aarch64-linux-gnu-gcc ./mage-bin -v go:build
mv ghostunnel ghostunnel-linux-arm64
- name: Upload artifact
uses: actions/upload-artifact@v7
with:
name: ghostunnel-linux-amd64-${{ matrix.os }}
path: ghostunnel-linux-amd64
- name: Upload artifact
uses: actions/upload-artifact@v7
with:
name: ghostunnel-linux-arm64-${{ matrix.os }}
path: ghostunnel-linux-arm64
build-darwin:
name: Build (MacOS)
strategy:
matrix:
version: [1.26.x]
runs-on: macos-latest
steps:
- name: Set up toolchain
uses: actions/setup-go@v6
with:
go-version: ${{ matrix.version }}
cache: false
id: go
- name: Checkout
uses: actions/checkout@v6
with:
fetch-depth: 100
fetch-tags: true
- name: Build binary
run: |
go tool mage -compile ./mage-bin
CGO_ENABLED=1 GOARCH=amd64 ./mage-bin -v go:build
mv ghostunnel ghostunnel-darwin-amd64
CGO_ENABLED=1 GOARCH=arm64 ./mage-bin -v go:build
mv ghostunnel ghostunnel-darwin-arm64
lipo -create -output ghostunnel-darwin-universal ghostunnel-darwin-amd64 ghostunnel-darwin-arm64
- name: Upload artifact
uses: actions/upload-artifact@v7
with:
name: ghostunnel-darwin-amd64
path: ghostunnel-darwin-amd64
- name: Upload artifact
uses: actions/upload-artifact@v7
with:
name: ghostunnel-darwin-arm64
path: ghostunnel-darwin-arm64
- name: Upload artifact
uses: actions/upload-artifact@v7
with:
name: ghostunnel-darwin-universal
path: ghostunnel-darwin-universal
build-windows:
name: Build (Windows)
strategy:
matrix:
version: [1.26.x]
runs-on: windows-latest
steps:
- name: Set up toolchain
uses: actions/setup-go@v6
with:
go-version: ${{ matrix.version }}
cache: false
id: go
- name: Checkout
uses: actions/checkout@v6
with:
fetch-depth: 100
fetch-tags: true
- name: Build binary
run: go tool mage -v go:build
- name: Upload artifact
uses: actions/upload-artifact@v7
with:
name: ghostunnel-windows-amd64
path: ghostunnel