8000 build release (#13) · cloudposse/github-status-updater@eec1388 · GitHub
[go: up one dir, main page]

Skip to content

Commit eec1388

Browse files
ostermanaknysh
andauthored
build release (#13)
* build release * rename steps * build the old way * build docker image * update badge * go get * triage * gopath * set gopath * set go path * convert to go module * refactor * Update .github/workflows/go.yml Co-authored-by: Andriy Knysh <aknysh@users.noreply.github.com> * Update .github/workflows/go.yml Co-authored-by: Andriy Knysh <aknysh@users.noreply.github.com> * Update .github/workflows/go.yml Co-authored-by: Andriy Knysh <aknysh@users.noreply.github.com> * upload artifacts * fix output path Co-authored-by: Andriy Knysh <aknysh@users.noreply.github.com>
1 parent 2ce4f11 commit eec1388

File tree

7 files changed

+108
-13
lines changed

7 files changed

+108
-13
lines changed

.github/workflows/docker.yml

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
name: "docker"
2+
on:
3+
push:
4+
branches:
5+
- master
6+
pull_request:
7+
types: [opened, synchronize, reopened]
8+
release:
9+
types:
10+
- created
11+
jobs:
12+
build-and-push:
13+
runs-on: ubuntu-latest
14+
steps:
15+
- name: "Checkout source code at current commit"
16+
uses: actions/checkout@v2
17+
- name: "Build and push docker image to DockerHub"
18+
uses: docker/build-push-action@v1
19+
with:
20+
username: ${{ secrets.DOCKERHUB_USERNAME }}
21+
password: ${{ secrets.DOCKERHUB_PASSWORD }}
22+
repository: ${{ github.repository }}
23+
registry: registry-1.docker.io
24+
tag_with_ref: true
25+
tag_with_sha: true

.github/workflows/go.yml

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
name: 'go'
2+
3+
on:
4+
release:
5+
types: [published]
6+
7+
pull_request:
8+
types: [opened, synchronize, reopened]
9+
10+
jobs:
11+
build:
12+
runs-on: ubuntu-latest
13+
steps:
14+
# Checkout the repo
15+
- name: 'Checkout'
16+
uses: actions/checkout@v2
17+
# Build Go binaries
18+
- name: 'Build Go binaries'
19+
uses: cloudposse/actions/go/build@0.15.0
20+
env:
21+
GO111MODULE: on
22+
# Architectures to build for
23+
GOX_OSARCH: >-
24+
windows/386
25+
windows/amd64
26+
freebsd/arm
27+
netbsd/386
28+
netbsd/amd64
29+
netbsd/arm
30+
linux/s390x
31+
linux/arm
32+
darwin/386
33+
darwin/amd64
34+
linux/386
35+
linux/amd64
36+
freebsd/amd64
37+
freebsd/386
38+
openbsd/386
39+
openbsd/amd64
40+
OUTPUT_PATH: ${{ github.workspace }}/release/${{ github.event.repository.name }}_
41+
- name: 'Upload artifacts'
42+
uses: actions/upload-artifact@v2
43+
with:
44+
name: ${{ github.event.repository.name }}
45+
path: ${{ github.workspace }}/release/*
46+
# Attach Go binaries to GitHub Release
47+
- name: 'Attach artifacts to GitHub Release'
48+
if: ${{ github.event_name == 'release' }}
49+
uses: cloudposse/actions/github/release-assets@0.15.0
50+
env:
51+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
52+
INPUT_PATH: ${{ github.workspace }}/release/${{ github.event.repository.name }}_*

Dockerfile

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
1-
FROM golang:1.11.2 as builder
2-
RUN mkdir -p /go/src/github.com/cloudposse/github-status-updater
3-
WORKDIR /go/src/github.com/cloudposse/github-status-updater
4-
COPY . .
5-
RUN go get && CGO_ENABLED=0 go build -v -o "./dist/bin/github-status-updater" *.go
1+
FROM golang:1.13.3-buster as builder
2+
ENV GO111MODULE=on
3+
ENV CGO_ENABLED=0
4+
WORKDIR /usr/src/
5+
COPY . /usr/src
6+
RUN go build -v -o "bin/github-status-updater" *.go
67

7-
8-
FROM alpine:3.8
8+
FROM alpine:3.12
99
RUN apk add --no-cache ca-certificates
10-
COPY --from=builder /go/src/github.com/cloudposse/github-status-updater/dist/bin/github-status-updater /usr/bin/github-status-updater
10+
COPY --from=builder /usr/src/bin/* /usr/bin/
1111
ENV PATH $PATH:/usr/bin
1212
ENTRYPOINT ["github-status-updater"]

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# github-status-updater [![Build Status](https://travis-ci.org/cloudposse/github-status-updater.svg?branch=master)](https://travis-ci.org/cloudposse/github-status-updater)
1+
# github-status-updater ![docker](https://github.com/cloudposse/github-status-updater/workflows/docker/badge.svg?branch=master) ![go](https://github.com/cloudposse/github-status-updater/workflows/go/badge.svg?branch=master)
22

33

44
Command line utility for updating GitHub commit statuses and enabling required status checks for pull requests.

glide.yaml

Lines changed: 0 additions & 4 deletions
This file was deleted.

go.mod

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
module github.com/cloudposse/github-status-updater
2+
3+
go 1.13
4+
5+
require (
6+
github.com/google/go-github v17.0.0+incompatible
7+
github.com/google/go-querystring v1.0.0 // indirect
8+
golang.org/x/net v0.0.0-20200625001655-4c5254603344
9+
)

go.sum

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
github.com/google/go-github v17.0.0+incompatible h1:N0LgJ1j65A7kfXrZnUDaYCs/Sf4rEjNlfyDHW9dolSY=
2+
github.com/google/go-github v17.0.0+incompatible/go.mod h1:zLgOLi98H3fifZn+44m+umXrS52loVEgC2AApnigrVQ=
3+
github.com/google/go-querystring v1.0.0 h1:Xkwi/a1rcvNg1PPYe5vI8GbeBY/jrVuDX5ASuANWTrk=
4+
github.com/google/go-querystring v1.0.0/go.mod h1:odCYkC5MyYFN7vkCjXpyrEuKhc/BUO6wN/zVPAxq5ck=
5+
golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
6+
golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto=
7+
golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
8+
golang.org/x/net v0.0.0-20200625001655-4c5254603344 h1:vGXIOMxbNfDTk/aXCmfdLgkrSV+Z2tcbze+pEc3v5W4=
9+
golang.org/x/net v0.0.0-20200625001655-4c5254603344/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA=
10+
golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
11+
golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
12+
golang.org/x/sys v0.0.0-20200323222414-85ca7c5b95cd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
13+
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=

0 commit comments

Comments
 (0)
0