diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 00000000..93d927cb --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,25 @@ +name: ci + +on: + pull_request: + push: + branches: + - master + +jobs: + build-and-test: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + + - uses: actions/setup-go@v5 + with: + go-version: stable + + - name: Build + env: + CGO_ENABLED: '0' + run: GOOS=linux GOARCH=amd64 go build ./... + + - name: Unit tests + run: go test ./api/... diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 00000000..ce17c2d0 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,36 @@ +name: release + +on: + push: + tags: + - 'v*' + +permissions: + contents: write + +jobs: + release: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + + - uses: actions/setup-go@v5 + with: + go-version: stable + + - name: Build linux binaries + env: + CGO_ENABLED: '0' + run: | + GOOS=linux GOARCH=amd64 go build -ldflags "-s -w" -o goofys-amd64 . + GOOS=linux GOARCH=arm64 go build -ldflags "-s -w" -o goofys-arm64 . + cp goofys-amd64 goofys + + - name: Create release and upload assets + env: + GH_TOKEN: ${{ github.token }} + run: | + gh release create "$GITHUB_REF_NAME" \ + --title "$GITHUB_REF_NAME" \ + --generate-notes \ + goofys goofys-amd64 goofys-arm64