Merge pull request #657 from ghostunnel/cs/docs #165
This file contains hidden or 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: Compile | |
| on: | |
| push: | |
| branches: [ master ] | |
| pull_request: | |
| branches: [ master ] | |
| 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@v3 | |
| with: | |
| install: true | |
| - name: Set up Go | |
| uses: actions/setup-go@v6 | |
| with: | |
| go-version: '1.26.x' | |
| - 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 }} | |
| 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 }} | |
| 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 }} | |
| 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 |