Skip to content

Nix flake: Add explicit nixpkgs dependency #80

Nix flake: Add explicit nixpkgs dependency

Nix flake: Add explicit nixpkgs dependency #80

Workflow file for this run

name: Go
on:
push:
branches: [ master ]
tags: [ v* ]
pull_request:
branches: [ master ]
jobs:
build:
name: Build
runs-on: ubuntu-latest
steps:
- name: Check out code into the Go module directory
uses: actions/checkout@v4
- name: Set up Go 1.22
uses: actions/setup-go@v5
with:
go-version: '1.22'
- name: Get dependencies
run: go get -v -t -d ./...
- name: Build (Smoke test)
run: CGO_ENABLED=0 go build -v ./...
- name: Test
run: CGO_ENABLED=0 go test -v ./...
- name: Login to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build Releases
run: |
# Platforms that REQUIRE Cgo (because they need libfuse) will be compiled with xgo.
# This produces builds at:
# - ./bin/pang-darwin-amd64
# - ./bin/pang-darwin-arm64
bash ci/xgo/xgo-build.sh ghcr.io/pangbox/pangfiles/xgo:bd83ed073fc2b89295f13375583f7be6592ac8e0
# Other platforms that do not require Cgo (because they prefer Bazilfuse or WinFSP over libfuse) are cross compiled natively.
CGO_ENABLED=0 GOOS=freebsd GOARCH=amd64 go build -o bin/pang-freebsd-amd64 ./cmd/pang
CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -o bin/pang-linux-amd64 ./cmd/pang
CGO_ENABLED=0 GOOS=windows GOARCH=amd64 go build -o bin/pang-windows-amd64.exe ./cmd/pang
- name: Upload builds
uses: actions/upload-artifact@v4
with:
name: bin
path: bin/*
lint:
name: Lint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Lint
uses: golangci/golangci-lint-action@v6
with:
version: v1.57.2
release:
name: Release
runs-on: ubuntu-latest
if: startsWith(github.ref, 'refs/tags/')
needs: build
steps:
- name: Download builds
uses: actions/download-artifact@v4
with:
name: bin
- name: Zip builds
run: |
for i in bin/*
do
OUT="$PWD/$(basename $i).zip"
cd "$(dirname $i)"
zip "$OUT" "$(basename $i)"
cd -
done
- name: Create Release
uses: softprops/action-gh-release@v2
with:
draft: true
generate_release_notes: true
fail_on_unmatched_files: true
files:
pang-macos-amd64.zip
pang-macos-arm64.zip
pang-freebsd-amd64.zip
pang-linux-amd64.zip
pang-windows-amd64.exe.zip