diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index d026b79..fefb35d 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -1,22 +1,15 @@ name: ci -on: - push: - branches: [ "master" ] - tags: [ "v**" ] - pull_request: - branches: [ "master" ] +on: [push, pull_request, workflow_dispatch] jobs: - build: runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 - uses: actions/setup-go@v4 with: - go-version: '1.21' - - run: go install github.com/caddyserver/xcaddy/cmd/xcaddy@latest + go-version: '1.22' - uses: gacts/install-hurl@v1 - name: Build @@ -25,12 +18,23 @@ jobs: - name: Test run: go test -v ./... - - name: Hurl Tests + - name: Run Hurl Tests run: ./test/exec.sh - - run: go build -o xtemplate ./cmd + - uses: thatisuday/go-cross-build@v1 + with: + platforms: 'linux/amd64, darwin/amd64, windows/amd64' + package: 'cmd' + name: 'xtemplate' + compress: 'true' + dest: 'dist' - uses: actions/upload-artifact@v3 with: - name: xtemplate - path: xtemplate + path: dist/* + + - name: Release + if: startsWith(github.ref, 'refs/tags/v') + uses: softprops/action-gh-release@v1 + with: + files: 'dist/*'