Skip to content

Commit

Permalink
build: prep for multi-OS releases
Browse files Browse the repository at this point in the history
  • Loading branch information
adamdecaf committed Jun 28, 2021
1 parent acbc8ef commit c243655
Show file tree
Hide file tree
Showing 5 changed files with 63 additions and 21 deletions.
3 changes: 3 additions & 0 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Changes

# Why Are Changes Being Made
37 changes: 37 additions & 0 deletions .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
# generated-from:d54019a30998e586e72aaea0fd977e77e59fb44cc41a59eed8d577acb16c06a9 DO NOT REMOVE, DO UPDATE

name: CodeQL Analysis

on:
push:
pull_request:
schedule:
- cron: '0 0 * * 0'

jobs:
CodeQL-Build:
strategy:
fail-fast: false
runs-on: ubuntu-latest
steps:
- name: Set up Go 1.x
uses: actions/setup-go@v2
with:
go-version: ^1.16
id: go

- name: Checkout repository
uses: actions/checkout@v2
with:
fetch-depth: 0

- name: Initialize CodeQL
uses: github/codeql-action/init@v1
with:
languages: go

- name: Install
run: make install

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v1
13 changes: 11 additions & 2 deletions .github/workflows/go.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest] # macos-latest, windows-latest
os: [ubuntu-latest, macos-latest, windows-latest]
steps:
- name: Set up Go 1.x
uses: actions/setup-go@v2
Expand Down Expand Up @@ -43,4 +43,13 @@ jobs:

- name: Docker Build
if: runner.os == 'Linux'
run: make docker
run: make dev-docker

- name: Docker Push
if: runner.os == 'Linux'
run: |+
echo "$DOCKER_PASSWORD" | docker login -u "$DOCKER_USERNAME" --password-stdin
make dev-push
env:
DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }}
DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }}
18 changes: 9 additions & 9 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest] # macos-latest, windows-latest
os: [ubuntu-latest, macos-latest, windows-latest]
steps:
- name: Set up Go 1.x
uses: actions/setup-go@v2
Expand Down Expand Up @@ -61,7 +61,7 @@ jobs:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest] # macos-latest, windows-latest
os: [ubuntu-latest, macos-latest, windows-latest]
steps:
- name: Set up Go 1.x
uses: actions/setup-go@v2
Expand Down Expand Up @@ -154,10 +154,10 @@ jobs:
DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }}
DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }}

# - name: Quay.io Push
# run: |+
# echo "$DOCKER_PASSWORD" | docker login -u "$DOCKER_USERNAME" --password-stdin quay.io
# make quay-push
# env:
# DOCKER_USERNAME: ${{ secrets.QUAY_USERNAME }}
# DOCKER_PASSWORD: ${{ secrets.QUAY_PASSWORD }}
- name: Quay.io Push
run: |+
echo "$DOCKER_PASSWORD" | docker login -u "$DOCKER_USERNAME" --password-stdin quay.io
make quay-push
env:
DOCKER_USERNAME: ${{ secrets.QUAY_USERNAME }}
DOCKER_PASSWORD: ${{ secrets.QUAY_PASSWORD }}
13 changes: 3 additions & 10 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

# generated-from:0f1cfb3f9faa0c83355794c5720cb80c30b77f4fcb2887d31d2887bd169db413 DO NOT REMOVE, DO UPDATE

PLATFORM=$(shell uname -s | tr '[:upper:]' '[:lower:]')
Expand Down Expand Up @@ -52,28 +51,23 @@ teardown:
docker: update
docker build --pull --build-arg VERSION=${VERSION} -t moov-io/ach-web-viewer:${VERSION} -f Dockerfile .
docker tag moov-io/ach-web-viewer:${VERSION} moov-io/ach-web-viewer:latest

docker tag moov-io/ach-web-viewer:${VERSION} moov/ach-web-viewer:${VERSION}
docker tag moov-io/ach-web-viewer:${VERSION} moov/ach-web-viewer:latest


docker-push:

docker push moov/ach-web-viewer:${VERSION}
docker push moov/ach-web-viewer:latest

.PHONY: dev-docker
dev-docker: update
docker build --pull --build-arg VERSION=${DEV_VERSION} -t moov-io/ach-web-viewer:${DEV_VERSION} -f Dockerfile .

docker tag moov-io/ach-web-viewer:${DEV_VERSION} moov/ach-web-viewer:${DEV_VERSION}


.PHONY: dev-push
dev-push:

docker push moov/ach-web-viewer:${DEV_VERSION}


# Extra utilities not needed for building

Expand Down Expand Up @@ -110,4 +104,3 @@ ifeq ($(OS),Windows_NT)
else
CGO_ENABLED=1 GOOS=$(PLATFORM) go build -o bin/ach-web-viewer-$(PLATFORM)-amd64 cmd/ach-web-viewer/*
endif

0 comments on commit c243655

Please sign in to comment.