diff --git a/.github/workflows/go.yml b/.github/workflows/go.yml new file mode 100644 index 00000000..32a8ee7f --- /dev/null +++ b/.github/workflows/go.yml @@ -0,0 +1,34 @@ +name: Go + +on: + push: + branches: [ master ] + pull_request: + +jobs: + + build: + name: Build + runs-on: ubuntu-latest + steps: + + - name: Set up Go 1.x + uses: actions/setup-go@v2 + with: + go-version: ^1 + id: go + + - name: Check out code into the Go module directory + uses: actions/checkout@v2 + + - name: Get dependencies + run: go get -v -t ./... + + - name: Build + run: go build -v ./... + + - name: Add quic.clemente.io to /etc/hosts + run: echo "127.0.0.1 quic.clemente.io" | sudo tee -a /etc/hosts + + - name: Test + run: go test -v -race -parallel 6 ./... diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 00000000..bea10aa3 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,32 @@ +name: Release + +on: + push: + tags: + - v* + +jobs: + goreleaser: + runs-on: ubuntu-latest + steps: + - name: Set up Go + uses: actions/setup-go@v2 + with: + go-version: ^1 + + - name: Checkout + uses: actions/checkout@v2 + + - name: Go module init + run: | + cd casket + go mod init casket + cd .. + + - name: Run GoReleaser + uses: goreleaser/goreleaser-action@v2 + with: + version: latest + args: release --rm-dist + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} \ No newline at end of file diff --git a/.gitignore b/.gitignore index 4df13ebe..e9f89b17 100644 --- a/.gitignore +++ b/.gitignore @@ -7,6 +7,8 @@ Vagrantfile dist/builds/ dist/release/ +dist/casket_* +dist/config.yaml error.log access.log @@ -14,6 +16,8 @@ access.log /*.conf Casketfile !casketfile/ +casket/go.mod +casket/go.sum og_static/ diff --git a/.goreleaser.yml b/.goreleaser.yml new file mode 100644 index 00000000..e0f5e364 --- /dev/null +++ b/.goreleaser.yml @@ -0,0 +1,32 @@ +builds: + - id: "casket" + main: main.go + dir: ./casket + binary: casket + goos: + - linux + - darwin + - windows + goarch: + - "386" + - amd64 + ignore: + - goos: darwin + goarch: 386 + hooks: + pre: + - go mod edit -require=github.com/tmpim/casket@{{.Tag}} casket/go.mod + +archives: + - format_overrides: + - goos: windows + format: zip +checksum: + algorithm: sha256 + +release: + github: + owner: tmpim + name: casket + draft: true + prerelease: auto \ No newline at end of file