From c2436555c0e9526652c8571f6da666fff7146a7b Mon Sep 17 00:00:00 2001 From: Adam Shannon Date: Mon, 28 Jun 2021 14:42:16 -0500 Subject: [PATCH] build: prep for multi-OS releases --- .github/PULL_REQUEST_TEMPLATE.md | 3 +++ .github/workflows/codeql.yml | 37 ++++++++++++++++++++++++++++++++ .github/workflows/go.yml | 13 +++++++++-- .github/workflows/release.yml | 18 ++++++++-------- Makefile | 13 +++-------- 5 files changed, 63 insertions(+), 21 deletions(-) create mode 100644 .github/PULL_REQUEST_TEMPLATE.md create mode 100644 .github/workflows/codeql.yml diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md new file mode 100644 index 00000000..8a0a2b43 --- /dev/null +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -0,0 +1,3 @@ +# Changes + +# Why Are Changes Being Made diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml new file mode 100644 index 00000000..985f0176 --- /dev/null +++ b/.github/workflows/codeql.yml @@ -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 diff --git a/.github/workflows/go.yml b/.github/workflows/go.yml index 168e983e..ec00a64a 100644 --- a/.github/workflows/go.yml +++ b/.github/workflows/go.yml @@ -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 @@ -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 }} diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 86b8efc8..7eab9d20 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -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 @@ -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 @@ -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 }} diff --git a/Makefile b/Makefile index 5b62a27a..2f571a40 100644 --- a/Makefile +++ b/Makefile @@ -1,4 +1,3 @@ - # generated-from:0f1cfb3f9faa0c83355794c5720cb80c30b77f4fcb2887d31d2887bd169db413 DO NOT REMOVE, DO UPDATE PLATFORM=$(shell uname -s | tr '[:upper:]' '[:lower:]') @@ -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 @@ -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 -