Skip to content

Commit

Permalink
build release (#13)
Browse files Browse the repository at this point in the history
* 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 <[email protected]>

* Update .github/workflows/go.yml

Co-authored-by: Andriy Knysh <[email protected]>

* Update .github/workflows/go.yml

Co-authored-by: Andriy Knysh <[email protected]>

* upload artifacts

* fix output path

Co-authored-by: Andriy Knysh <[email protected]>
  • Loading branch information
osterman and aknysh authored Jul 1, 2020
1 parent 2ce4f11 commit eec1388
Show file tree
Hide file tree
Showing 7 changed files with 108 additions and 13 deletions.
25 changes: 25 additions & 0 deletions .github/workflows/docker.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: "docker"
on:
push:
branches:
- master
pull_request:
types: [opened, synchronize, reopened]
release:
types:
- created
jobs:
build-and-push:
runs-on: ubuntu-latest
steps:
- name: "Checkout source code at current commit"
uses: actions/checkout@v2
- name: "Build and push docker image to DockerHub"
uses: docker/build-push-action@v1
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_PASSWORD }}
repository: ${{ github.repository }}
registry: registry-1.docker.io
tag_with_ref: true
tag_with_sha: true
52 changes: 52 additions & 0 deletions .github/workflows/go.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
name: 'go'

on:
release:
types: [published]

pull_request:
types: [opened, synchronize, reopened]

jobs:
build:
runs-on: ubuntu-latest
steps:
# Checkout the repo
- name: 'Checkout'
uses: actions/checkout@v2
# Build Go binaries
- name: 'Build Go binaries'
uses: cloudposse/actions/go/[email protected]
env:
GO111MODULE: on
# Architectures to build for
GOX_OSARCH: >-
windows/386
windows/amd64
freebsd/arm
netbsd/386
netbsd/amd64
netbsd/arm
linux/s390x
linux/arm
darwin/386
darwin/amd64
linux/386
linux/amd64
freebsd/amd64
freebsd/386
openbsd/386
openbsd/amd64
OUTPUT_PATH: ${{ github.workspace }}/release/${{ github.event.repository.name }}_
- name: 'Upload artifacts'
uses: actions/upload-artifact@v2
with:
name: ${{ github.event.repository.name }}
path: ${{ github.workspace }}/release/*
# Attach Go binaries to GitHub Release
- name: 'Attach artifacts to GitHub Release'
if: ${{ github.event_name == 'release' }}
uses: cloudposse/actions/github/[email protected]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
INPUT_PATH: ${{ github.workspace }}/release/${{ github.event.repository.name }}_*
16 changes: 8 additions & 8 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
FROM golang:1.11.2 as builder
RUN mkdir -p /go/src/github.com/cloudposse/github-status-updater
WORKDIR /go/src/github.com/cloudposse/github-status-updater
COPY . .
RUN go get && CGO_ENABLED=0 go build -v -o "./dist/bin/github-status-updater" *.go
FROM golang:1.13.3-buster as builder
ENV GO111MODULE=on
ENV CGO_ENABLED=0
WORKDIR /usr/src/
COPY . /usr/src
RUN go build -v -o "bin/github-status-updater" *.go


FROM alpine:3.8
FROM alpine:3.12
RUN apk add --no-cache ca-certificates
COPY --from=builder /go/src/github.com/cloudposse/github-status-updater/dist/bin/github-status-updater /usr/bin/github-status-updater
COPY --from=builder /usr/src/bin/* /usr/bin/
ENV PATH $PATH:/usr/bin
ENTRYPOINT ["github-status-updater"]
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# github-status-updater [![Build Status](https://travis-ci.org/cloudposse/github-status-updater.svg?branch=master)](https://travis-ci.org/cloudposse/github-status-updater)
# 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)


Command line utility for updating GitHub commit statuses and enabling required status checks for pull requests.
Expand Down
4 changes: 0 additions & 4 deletions glide.yaml

This file was deleted.

9 changes: 9 additions & 0 deletions go.mod
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
module github.com/cloudposse/github-status-updater

go 1.13

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

0 comments on commit eec1388

Please sign in to comment.