Skip to content

Commit 6a7ef36

Browse files
authored
Merge pull request #192 from insidieux/release-assets
Release assets
2 parents f842348 + ce91807 commit 6a7ef36

6 files changed

Lines changed: 172 additions & 298 deletions

File tree

.dockerignore

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
*
2+
!go.mod
3+
!go.sum
4+
!*.go
5+
!sql-migrate/*.go
6+
!sqlparse/*.go

.github/workflows/release.yml

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
name: Release
2+
3+
on:
4+
release:
5+
types: [ created ]
6+
7+
jobs:
8+
releases-matrix:
9+
name: Release Go Binary
10+
runs-on: ubuntu-latest
11+
strategy:
12+
matrix:
13+
goos: [ linux, windows, darwin ]
14+
goarch: [ amd64 ]
15+
steps:
16+
- name: Checkout
17+
uses: actions/checkout@v2
18+
- uses: wangyoucao577/go-release-action@v1.15
19+
with:
20+
github_token: ${{ secrets.GITHUB_TOKEN }}
21+
goos: ${{ matrix.goos }}
22+
goarch: ${{ matrix.goarch }}
23+
goversion: 1.16
24+
pre_command: export CGO_ENABLED=0
25+
project_path: "./sql-migrate"

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
.*.swp
22
*.test
33
.idea
4+
/vendor/
45

56
/sql-migrate/test.db
67
/test.db

Dockerfile

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
ARG GO_VERSION=1.16.2
2+
ARG ALPINE_VERSION=3.12
3+
4+
### Vendor
5+
FROM golang:${GO_VERSION} as vendor
6+
COPY . /project
7+
WORKDIR /project
8+
RUN go mod tidy && go mod vendor
9+
10+
### Build binary
11+
FROM golang:${GO_VERSION} as build-binary
12+
COPY . /project
13+
COPY --from=vendor /project/vendor /project/vendor
14+
WORKDIR /project
15+
RUN GOOS=linux GOARCH=amd64 CGO_ENABLED=0 GO111MODULE=on go build \
16+
-v \
17+
-mod vendor \
18+
-o /project/bin/sql-migrate \
19+
/project/sql-migrate
20+
21+
### Image
22+
FROM alpine:${ALPINE_VERSION} as image
23+
COPY --from=build-binary /project/bin/sql-migrate /usr/local/bin/sql-migrate
24+
RUN chmod +x /usr/local/bin/sql-migrate
25+
ENTRYPOINT ["sql-migrate"]

go.mod

Lines changed: 12 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,18 @@
11
module github.com/rubenv/sql-migrate
22

3-
go 1.11
3+
go 1.16
44

55
require (
6-
github.com/denisenkom/go-mssqldb v0.0.0-20191001013358-cfbb681360f0
7-
github.com/go-sql-driver/mysql v1.4.1
8-
github.com/gobuffalo/packr/v2 v2.7.1
9-
github.com/godror/godror v0.13.3
10-
github.com/lib/pq v1.2.0
11-
github.com/mattn/go-oci8 v0.0.7
12-
github.com/mattn/go-sqlite3 v1.12.0
13-
github.com/mitchellh/cli v1.0.0
14-
github.com/olekukonko/tablewriter v0.0.2
15-
github.com/ziutek/mymysql v1.5.4 // indirect
16-
google.golang.org/appengine v1.6.5 // indirect
17-
gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127
6+
github.com/denisenkom/go-mssqldb v0.9.0
7+
github.com/go-sql-driver/mysql v1.5.0
8+
github.com/gobuffalo/packr/v2 v2.8.1
9+
github.com/godror/godror v0.24.2
10+
github.com/lib/pq v1.10.0
11+
github.com/mattn/go-oci8 v0.1.1
12+
github.com/mattn/go-sqlite3 v1.14.6
13+
github.com/mitchellh/cli v1.1.2
14+
github.com/olekukonko/tablewriter v0.0.5
15+
gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c
1816
gopkg.in/gorp.v1 v1.7.2
19-
gopkg.in/yaml.v2 v2.2.5
17+
gopkg.in/yaml.v2 v2.4.0
2018
)

0 commit comments

Comments
 (0)