Skip to content

chore: workflow updates #17

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

Merged
merged 3 commits into from
Nov 9, 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
22 changes: 5 additions & 17 deletions .github/renovate.json
Original file line number Diff line number Diff line change
@@ -1,29 +1,17 @@
{
"$schema": "https://docs.renovatebot.com/renovate-schema.json",
"extends": [
"config:recommended",
":disableDependencyDashboard"
],
"extends": ["config:recommended", ":disableDependencyDashboard"],
"automerge": true,
"automergeStrategy": "squash",
"enabledManagers": [
"dockerfile",
"github-actions",
"custom.regex"
],
"enabledManagers": ["custom.regex", "dockerfile", "github-actions"],
"customManagers": [
{
"customType": "regex",
"description": "Update sqlcmd version",
"description": ["Update sqlcmd version"],
"datasourceTemplate": "github-releases",
"depNameTemplate": "microsoft/go-sqlcmd",
"fileMatch": [
"^Dockerfile$",
"^version$"
],
"matchStrings": [
"(?:ARG )?SQLCMD_VERSION=(?<currentValue>.+?)\\s"
]
"fileMatch": ["^Dockerfile$"],
"matchStrings": ["ARG SQLCMD_VERSION=(?<currentValue>.+?)\\s"]
}
]
}
8 changes: 3 additions & 5 deletions .github/workflows/docker.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ name: Docker
on:
pull_request:
branches: [main]
release:
types: [published]
push:
branches: [main]

permissions:
packages: write
Expand All @@ -22,14 +22,12 @@ jobs:
- uses: docker/setup-buildx-action@v3

- name: Login to Docker Hub
if: ${{ github.event_name == 'release' }}
uses: docker/login-action@v3
with:
username: ${{ github.repository_owner }}
password: ${{ secrets.DOCKERHUB_TOKEN }}

- name: Login to GitHub Container Registry
if: ${{ github.event_name == 'release' }}
uses: docker/login-action@v3
with:
registry: ghcr.io
Expand All @@ -51,4 +49,4 @@ jobs:
tags: ${{ steps.meta.outputs.tags }}
platforms: linux/amd64,linux/arm64,linux/s390x
provenance: false
push: ${{ github.event_name == 'release' }}
push: ${{ github.event_name == 'push' }}
27 changes: 0 additions & 27 deletions .github/workflows/release.yaml

This file was deleted.

8 changes: 4 additions & 4 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
FROM --platform=${BUILDPLATFORM} alpine:3 AS tools
ARG SQLCMD_VERSION=v1.8.0
ARG TARGETARCH
RUN apk add jq --no-cache && \
wget -c -O - $(wget -q -O - https://api.github.com/repos/microsoft/go-sqlcmd/releases/tags/${SQLCMD_VERSION} \
| jq -r --arg arch "${TARGETARCH}" '.assets[] | select(.name | test(".*linux.*" + $arch + ".*")).browser_download_url' ) \
RUN apk add --update-cache --no-cache curl jq xz && \
curl -sSL $(curl -sSL "https://api.github.com/repos/microsoft/go-sqlcmd/releases/tags/${SQLCMD_VERSION}" | \
jq -r --arg arch "${TARGETARCH}" '.assets[] | select(.name | test(".*linux.*" + $arch + ".*")).browser_download_url') \
| tar -xj

FROM gcr.io/distroless/static:nonroot
FROM gcr.io/distroless/static:nonroot@sha256:3a03fc0826340c7deb82d4755ca391bef5adcedb8892e58412e1a6008199fa91
COPY --from=tools /sqlcmd /sqlcmd
USER nonroot:nonroot
ENTRYPOINT ["/sqlcmd"]
9 changes: 5 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
# [go-sqlcmd](https://github.com/microsoft/go-sqlcmd) docker image

[![Docker](https://github.com/bonddim/go-sqlcmd/actions/workflows/docker.yaml/badge.svg?event=release)](https://github.com/bonddim/go-sqlcmd/actions/workflows/docker.yaml)
![Docker Image Size](https://img.shields.io/docker/image-size/bonddim/go-sqlcmd)
[![Docker Pulls](https://img.shields.io/docker/pulls/bonddim/go-sqlcmd)](https://hub.docker.com/r/bonddim/go-sqlcmd)
[![GitHub Release](https://img.shields.io/github/v/release/bonddim/go-sqlcmd)](https://github.com/bonddim/go-sqlcmd/releases/latest)
[docker-hub]: https://hub.docker.com/r/bonddim/go-sqlcmd
[![Docker](https://github.com/bonddim/go-sqlcmd/actions/workflows/docker.yaml/badge.svg)](https://github.com/bonddim/go-sqlcmd/actions/workflows/docker.yaml)
[![Docker Image Version](https://img.shields.io/docker/v/bonddim/go-sqlcmd)][docker-hub]
[![Docker Image Size](https://img.shields.io/docker/image-size/bonddim/go-sqlcmd)][docker-hub]
[![Docker Pulls](https://img.shields.io/docker/pulls/bonddim/go-sqlcmd)][docker-hub]
[![GitHub License](https://img.shields.io/github/license/bonddim/go-sqlcmd)](https://github.com/bonddim/go-sqlcmd?tab=MIT-1-ov-file)

## About
Expand Down
1 change: 0 additions & 1 deletion version

This file was deleted.