Skip to content

Commit

Permalink
add release workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
terjesannum committed Mar 23, 2023
1 parent 8071bab commit 9df2165
Showing 1 changed file with 96 additions and 0 deletions.
96 changes: 96 additions & 0 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,96 @@
name: Release

on:
push:
branches:
- master
paths:
- charts/easee-exporter/Chart.yaml

jobs:
release-docker:
name: Release docker
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Set up QEMU
uses: docker/setup-qemu-action@v2
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Login GHCR
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Get release version
id: get_version
run: "sed -n 's/^version: /version=/p' charts/easee-exporter/Chart.yaml >> $GITHUB_OUTPUT"
- name: Build and push
id: docker_build
uses: docker/build-push-action@v4
with:
context: .
platforms: linux/amd64,linux/arm64,linux/arm/v7
provenance: false
push: true
tags: ghcr.io/${{ github.repository_owner }}/easee-exporter:${{ steps.get_version.outputs.version }},ghcr.io/${{ github.repository_owner }}/easee-exporter:latest

release-chart:
name: Release chart
needs: release-docker
permissions:
contents: write
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0

- name: Configure Git
run: |
git config user.name "$GITHUB_ACTOR"
git config user.email "[email protected]"
- name: Install Helm
uses: azure/setup-helm@v3
with:
token: "${{ secrets.GITHUB_TOKEN }}"

- name: Run chart-releaser
uses: helm/[email protected]
env:
CR_TOKEN: "${{ secrets.GITHUB_TOKEN }}"

release-binaries:
name: Release binaries
needs: release-chart
permissions:
contents: write
runs-on: ubuntu-latest
strategy:
matrix:
goos: [linux, windows, darwin]
goarch: [amd64, arm, arm64]
exclude:
- goarch: arm
goos: windows
- goarch: arm64
goos: windows
- goarch: arm
goos: darwin
steps:
- uses: actions/checkout@v3
- name: Get version
id: get_version
run: "sed -n 's/^version: /version=/p' charts/easee-exporter/Chart.yaml >> $GITHUB_OUTPUT"
- uses: wangyoucao577/[email protected]
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
goos: ${{ matrix.goos }}
goarch: ${{ matrix.goarch }}
asset_name: "easee-exporter-${{ steps.get_version.outputs.version }}-${{ matrix.goos }}-${{ matrix.goarch }}"
release_tag: "easee-exporter-${{ steps.get_version.outputs.version }}"
md5sum: false

0 comments on commit 9df2165

Please sign in to comment.