Skip to content

Commit

Permalink
Update Go version in Docker / CI, upgrade Go deps, upgrade JS deps
Browse files Browse the repository at this point in the history
  • Loading branch information
brendan-ward committed Oct 19, 2023
1 parent c4c18f5 commit 97a3a41
Show file tree
Hide file tree
Showing 13 changed files with 914 additions and 859 deletions.
2 changes: 1 addition & 1 deletion .github/actions/build_arm64/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM golang:1.20-bullseye
FROM golang:1.21-bullseye

RUN \
dpkg --add-architecture arm64 && \
Expand Down
2 changes: 1 addition & 1 deletion .github/actions/build_x386_64/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM golang:1.20-bullseye
FROM golang:1.21-bullseye

RUN \
apt-get update && \
Expand Down
88 changes: 44 additions & 44 deletions .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
@@ -1,49 +1,49 @@
name: "CodeQL"

on:
push:
branches: [main]
pull_request:
branches: [main]
schedule:
- cron: "43 1 * * 6"
push:
branches: [main]
pull_request:
branches: [main]
schedule:
- cron: "43 1 * * 6"

jobs:
analyze:
name: Analyze
runs-on: ubuntu-latest
permissions:
actions: read
contents: read
security-events: write

strategy:
fail-fast: false
matrix:
go: [1.20.x]

steps:
- name: Install GCC (Ubuntu)
run: |
sudo apt update
sudo apt install -y gcc-multilib g++-multilib
shell: bash

- name: Install Go
uses: actions/setup-go@v3
with:
go-version: ${{ matrix.go }}

- name: Checkout repository
uses: actions/checkout@v2.5.0

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

- name: Build
run: go build .

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v2
analyze:
name: Analyze
runs-on: ubuntu-latest
permissions:
actions: read
contents: read
security-events: write

strategy:
fail-fast: false
matrix:
go: [1.21.x]

steps:
- name: Install GCC (Ubuntu)
run: |
sudo apt update
sudo apt install -y gcc-multilib g++-multilib
shell: bash

- name: Install Go
uses: actions/setup-go@v4
with:
go-version: ${{ matrix.go }}

- name: Checkout repository
uses: actions/checkout@v4

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

- name: Build
run: go build .

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v2
113 changes: 60 additions & 53 deletions .github/workflows/docker.yml
Original file line number Diff line number Diff line change
@@ -1,63 +1,70 @@
name: Build Docker images

on:
push:
branches:
- main
tags:
- "v*.*.*"
pull_request:
paths:
- ".github/workflows/docker.yml"
- "Dockerfile"
- "go.sum"
workflow_dispatch:
push:
branches:
- main
tags:
- "v*.*.*"
pull_request:
paths:
- ".github/workflows/docker.yml"
- "Dockerfile"
- "go.sum"
workflow_dispatch:

env:
REGISTRY: ghcr.io
IMAGE_NAME: ${{ github.repository }}
# disable unknown/unknown arch from showing up in ghcr.io
BUILDX_NO_DEFAULT_ATTESTATIONS: 1
REGISTRY: ghcr.io
IMAGE_NAME: ${{ github.repository }}
# disable unknown/unknown arch from showing up in ghcr.io

jobs:
buildx:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Set up QEMU
uses: docker/setup-qemu-action@v2
with:
platforms: "linux/amd64,linux/arm64"
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
id: buildx
with:
install: true
buildx:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
concurrency:
# cancel jobs on PRs only
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: ${{ github.ref != 'refs/heads/main' }}
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
with:
platforms: "linux/amd64,linux/arm64"
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
id: buildx
with:
install: true

- name: Docker meta
id: meta
uses: docker/metadata-action@v4
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
# add "type=ref,event=pr" if needed to test a PR
tags: |
type=raw,value=latest,enable={{is_default_branch}}
type=semver,pattern={{version}}
- name: Docker meta
id: meta
uses: docker/metadata-action@v5
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
# add "type=ref,event=pr" if needed to test a PR
tags: |
type=raw,value=latest,enable={{is_default_branch}}
type=semver,pattern={{version}}
- name: Login to Github Container Registry
if: github.event_name != 'pull_request'
uses: docker/login-action@v2
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Login to Github Container Registry
if: github.event_name != 'pull_request'
uses: docker/login-action@v2
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Build and push
uses: docker/build-push-action@v4
with:
context: .
platforms: linux/amd64,linux/arm64
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
- name: Build and push
uses: docker/build-push-action@v5
with:
context: .
platforms: linux/amd64,linux/arm64
provenance: false
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
40 changes: 20 additions & 20 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,26 +1,26 @@
name: Build Go Binaries for Release

on:
release:
types: [published, edited]
release:
types: [published, edited]

jobs:
build_x386_64:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Make binaries
uses: ./.github/actions/build_x386_64
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
build_x386_64:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Make binaries
uses: ./.github/actions/build_x386_64
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

build_arm64:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Make binaries
uses: ./.github/actions/build_arm64
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
build_arm64:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Make binaries
uses: ./.github/actions/build_arm64
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Loading

0 comments on commit 97a3a41

Please sign in to comment.