From 0cecb8985eac1c13a5be88ee11b2abd5150d05af Mon Sep 17 00:00:00 2001 From: Christian Hoffmeister Date: Sat, 13 Nov 2021 08:14:00 +0100 Subject: [PATCH] add github release action --- .github/workflows/release.yml | 36 +++++++++++++++++++++++++++++++++++ Makefile | 4 +--- 2 files changed, 37 insertions(+), 3 deletions(-) create mode 100644 .github/workflows/release.yml diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..955c437 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,36 @@ +name: release +on: + push: + tags: + - "v*" +env: + GO111MODULE: on +jobs: + release: + runs-on: ubuntu-latest + steps: + - uses: actions/setup-go@v2 + with: + go-version: 1.17.x + - uses: actions/checkout@v2 + with: + fetch-depth: 0 + - uses: docker/login-action@v1 + with: + registry: https://ghcr.io + username: choffmeister + password: ${{ secrets.GITHUB_TOKEN }} + - uses: docker/metadata-action@v3 + with: + images: ghcr.io/choffmeister/git-ops-update + tags: | + type=semver,pattern={{version}} + type=semver,pattern={{major}}.{{minor}} + id: docker-meta + - uses: docker/build-push-action@v2 + with: + context: . + file: ./Dockerfile + push: true + tags: ${{ steps.docker-meta.outputs.tags }} + labels: ${{ steps.meta.outputs.labels }} diff --git a/Makefile b/Makefile index ca9cf46..1b795b9 100644 --- a/Makefile +++ b/Makefile @@ -7,9 +7,7 @@ BIN := git-ops-update REGISTRY ?= ghcr.io/choffmeister IMAGE := $(REGISTRY)/$(BIN) - -# This version-strategy uses git tags to set the version string. -VERSION := $(shell git describe --tags --always --dirty) +VERSION := test MAIN := ./cmd/git-ops-update TEST := ./internal