Skip to content

Commit

Permalink
feat: github ci release
Browse files Browse the repository at this point in the history
  • Loading branch information
devthejo committed Aug 31, 2022
1 parent db8fa62 commit b5a9cca
Show file tree
Hide file tree
Showing 3 changed files with 98 additions and 0 deletions.
53 changes: 53 additions & 0 deletions .github/workflows/docker-release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
name: Docker Release

on:
push:
tags:
- 'v*.*.*'

concurrency:
cancel-in-progress: true
group: docker-release-${{ github.ref_name }}

jobs:
build-and-push-image:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write

steps:
- name: Checkout repository
uses: actions/checkout@v2

- name: Log in to the Container registry
uses: docker/login-action@v1
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@v3
with:
images: ghcr.io/${{ github.repository }}
tags: |
type=schedule
type=ref,event=branch
type=ref,event=pr
type=semver,pattern={{version}}
type=semver,pattern={{major}}.{{minor}}
type=semver,pattern={{major}}
type=sha
type=raw,value=latest,enable=${{ github.ref == format('refs/heads/{0}', github.event.repository.default_branch) }}
- name: Build and push Docker image
uses: docker/build-push-action@v2
with:
context: .
file: Dockerfile
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}

14 changes: 14 additions & 0 deletions .github/workflows/github-release.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
name: Github Release

on: push


jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Release
uses: softprops/action-gh-release@v1
if: startsWith(github.ref, 'refs/tags/')
31 changes: 31 additions & 0 deletions .github/workflows/go-release.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: Go Release

on:
release:
types: [created]

jobs:
releases-matrix:
name: Release Go Binary
runs-on: ubuntu-latest
strategy:
matrix:
# build and publish in parallel: linux/386, linux/amd64, linux/arm64, windows/386, windows/amd64, darwin/amd64, darwin/arm64
goos: [linux, windows, darwin]
goarch: ["386", amd64, arm64]
exclude:
- goarch: "386"
goos: darwin
- goarch: arm64
goos: windows
steps:
- uses: actions/checkout@v3
- uses: wangyoucao577/[email protected]
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
goos: ${{ matrix.goos }}
goarch: ${{ matrix.goarch }}
goversion: "https://dl.google.com/go/go1.18.linux-amd64.tar.gz"
project_path: "./cmd"
binary_name: "rollout-status"
# extra_files: LICENSE README.md

0 comments on commit b5a9cca

Please sign in to comment.