Skip to content

Commit

Permalink
feat: github actiosn for testing and releases
Browse files Browse the repository at this point in the history
  • Loading branch information
Lustyn authored Jul 31, 2020
2 parents 2c1e6c2 + 85dc8a3 commit d74b48e
Show file tree
Hide file tree
Showing 4 changed files with 102 additions and 0 deletions.
34 changes: 34 additions & 0 deletions .github/workflows/go.yml
Original file line number Diff line number Diff line change
@@ -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 ./...
32 changes: 32 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -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 }}
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,17 @@ Vagrantfile

dist/builds/
dist/release/
dist/casket_*
dist/config.yaml

error.log
access.log

/*.conf
Casketfile
!casketfile/
casket/go.mod
casket/go.sum

og_static/

Expand Down
32 changes: 32 additions & 0 deletions .goreleaser.yml
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit d74b48e

Please sign in to comment.