Skip to content

Commit

Permalink
Update actions, pre-commit and docker image (#19)
Browse files Browse the repository at this point in the history
  • Loading branch information
tulir authored Feb 17, 2024
1 parent 492e6fe commit 9c5f783
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 19 deletions.
28 changes: 14 additions & 14 deletions .github/workflows/go.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,18 @@ name: Go
on: [push, pull_request]

env:
GO_VERSION: "1.21"
GO_VERSION: "1.22"
GHCR_REGISTRY: ghcr.io
GHCR_REGISTRY_IMAGE: "ghcr.io/${{ github.repository }}"

jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- name: Set up Go ${{ env.GO_VERSION }}
uses: actions/setup-go@v3
uses: actions/setup-go@v5
with:
go-version: ${{ env.GO_VERSION }}
cache: true
Expand All @@ -26,17 +26,17 @@ jobs:
export PATH="$HOME/go/bin:$PATH"
- name: Run pre-commit
uses: pre-commit/[email protected].0
uses: pre-commit/[email protected].1

build:
runs-on: ubuntu-latest
env:
CGO_ENABLED: "0"
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- name: Set up Go ${{ env.GO_VERSION }}
uses: actions/setup-go@v3
uses: actions/setup-go@v5
with:
go-version: ${{ env.GO_VERSION }}
cache: true
Expand All @@ -45,28 +45,28 @@ jobs:
run: ./ci-build-all.sh

- name: Upload linux/amd64 artifact
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: bbctl-linux-amd64
path: bbctl-linux-amd64
if-no-files-found: error

- name: Upload linux/arm64 artifact
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: bbctl-linux-arm64
path: bbctl-linux-arm64
if-no-files-found: error

- name: Upload macos/amd64 artifact
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: bbctl-macos-amd64
path: bbctl-macos-amd64
if-no-files-found: error

- name: Upload macos/arm64 artifact
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: bbctl-macos-arm64
path: bbctl-macos-arm64
Expand All @@ -76,17 +76,17 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
uses: docker/setup-buildx-action@v3

- name: Login to registry
uses: docker/login-action@v2
uses: docker/login-action@v3
with:
registry: ${{ env.GHCR_REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Docker Build
uses: docker/build-push-action@v4
uses: docker/build-push-action@v5
with:
cache-from: ${{ env.GHCR_REGISTRY_IMAGE }}:latest
pull: true
Expand All @@ -103,7 +103,7 @@ jobs:
if: github.ref == 'refs/heads/main'
steps:
- name: Login to registry
uses: docker/login-action@v2
uses: docker/login-action@v3
with:
registry: ${{ env.GHCR_REGISTRY }}
username: ${{ github.actor }}
Expand Down
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.4.0
rev: v4.5.0
hooks:
- id: trailing-whitespace
exclude_types: [markdown]
Expand Down
8 changes: 4 additions & 4 deletions docker/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
FROM dock.mau.dev/tulir/lottieconverter:alpine-3.18 AS lottie
FROM dock.mau.dev/tulir/lottieconverter:alpine-3.19 AS lottie

FROM golang:1.21-alpine3.18 AS builder
FROM golang:1.22-alpine3.19 AS builder

COPY . /build/
RUN cd /build && ./build.sh

FROM alpine:3.18
FROM alpine:3.19

RUN apk add --no-cache bash curl jq git ffmpeg \
# Python for python bridges
Expand All @@ -14,7 +14,7 @@ RUN apk add --no-cache bash curl jq git ffmpeg \
py3-magic py3-ruamel.yaml py3-aiohttp py3-pillow py3-olm py3-pycryptodome

COPY --from=lottie /cryptg-*.whl /tmp/
RUN pip3 install /tmp/cryptg-*.whl && rm -f /tmp/cryptg-*.whl
RUN pip3 install --break-system-packages /tmp/cryptg-*.whl && rm -f /tmp/cryptg-*.whl

COPY --from=builder /build/bbctl /usr/local/bin/bbctl
COPY --from=lottie /usr/lib/librlottie.so* /usr/lib/
Expand Down

0 comments on commit 9c5f783

Please sign in to comment.