Skip to content

Commit

Permalink
add release pipeline and update main. (#3)
Browse files Browse the repository at this point in the history
  • Loading branch information
pehlicd authored Jul 14, 2023
1 parent 1d4b03d commit da8cb4e
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 10 deletions.
11 changes: 1 addition & 10 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,23 +47,14 @@ jobs:
type=semver,pattern={{major}}.{{minor}}
- name: Build and push Docker image
if: "contains(github.ref, 'main')"
if: "!contains(github.ref, 'dev-*')"
uses: docker/build-push-action@v4
with:
context: .
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}

- name: Build and push Docker image with dev tag
if: "contains(github.ref, 'main')"
uses: docker/build-push-action@v4
with:
context: .
push: true
tags: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:dev-latest
labels: ${{ steps.meta.outputs.labels }}

- name: Build and push Docker image from user-dev branches
if: "!contains(github.ref, 'main')"
uses: docker/build-push-action@v4
Expand Down
30 changes: 30 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: Go Release

on:
push:
tags:
- 'v*'

permissions:
contents: write
packages: write
issues: write

jobs:
goreleaser:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- run: git fetch --force --tags
- uses: actions/setup-go@v4
with:
go-version: stable
- uses: goreleaser/goreleaser-action@v4
with:
distribution: goreleaser
version: latest
args: release --clean
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
[![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://opensource.org/licenses/Apache-2.0)
![Go version](https://img.shields.io/github/go-mod/go-version/cnwizards/node-wizard)
![Release](https://img.shields.io/github/v/release/cnwizards/node-wizard)
![Docker Build](https://github.com/cnwizards/node-wizard/actions/workflows/main.yml/badge.svg?branch=main)
[![Go Report Card](https://goreportcard.com/badge/github.com/cnwizards/node-wizard)](https://goreportcard.com/report/github.com/cnwizards/node-wizard)
# Node Wizard
Expand Down

0 comments on commit da8cb4e

Please sign in to comment.