Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CI: Fix broken build by using most recent Golang version (1.21) #112

Merged
merged 2 commits into from
Jan 13, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -1 +1,4 @@
.pytest_cache
.venv
build
cratedb-prometheus-adapter
25 changes: 25 additions & 0 deletions .github/workflows/builds.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# Stage builds through GitHub Actions (GHA).
name: Builds

on:
pull_request: ~
push:
branches: [ main ]

# Allow job to be triggered manually.
workflow_dispatch:

# Run builds each night.
schedule:
- cron: '0 5 * * *'

jobs:
docker:
runs-on: ubuntu-latest
steps:

- name: Acquire sources
uses: actions/checkout@v4

- name: Run release job
run: ./devtools/release.sh
10 changes: 7 additions & 3 deletions .github/workflows/release.yml → .github/workflows/oci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,20 @@
# https://github.com/crazy-max/ghaction-docker-meta
# https://github.com/docker/build-push-action
# https://github.com/MarcelCoding/luna/blob/main/.github/workflows/ci.yaml
name: Release
name: OCI

on:
schedule:
- cron: '0 10 * * *' # everyday at 10am
push:
tags:
- '*.*.*'

# Allow job to be triggered manually.
workflow_dispatch:

# Build nightlies.
schedule:
- cron: '0 5 * * *'
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it ok that it's on the same time with builds.yml?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes it's okay. Both workflow jobs are independent from each other.


env:
GHCR_IMAGE_NAME: crate/cratedb-prometheus-adapter

Expand Down
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM golang:1.19 as builder
FROM golang:1.21 as builder
WORKDIR /go/src/github.com/crate/cratedb-prometheus-adapter
COPY . /go/src/github.com/crate/cratedb-prometheus-adapter/
RUN CGO_ENABLED=0 GOOS=linux go build
Expand Down
2 changes: 1 addition & 1 deletion devtools/release.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
# Run release archive builder within Docker container.
#

FROM golang:1.16
FROM golang:1.21

RUN apt-get update && apt-get --yes install zip

Expand Down
2 changes: 1 addition & 1 deletion devtools/release.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ rm build/*
NAME="cratedb-prometheus-adapter"

# Use most recent git tag as version number.
# TODO: Should this be made more elaborate?
# TODO: Should this be made more elaborate, to also account for patch and nightly releases?
VERSION="$(git tag | tail -n1)"

# Build program for multiple architectures.
Expand Down
Loading