go 1.21.4, update dependencies #39
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Release | |
on: | |
push: | |
branches: | |
- master | |
paths: | |
- charts/tibber-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/tibber-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 }}/tibber-exporter:${{ steps.get_version.outputs.version }},ghcr.io/${{ github.repository_owner }}/tibber-exporter:latest | |
build-args: | | |
UA=tibber-exporter/${{ steps.get_version.outputs.version }} (${{ github.server_url}}/${{ github.repository }}) | |
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 "$GITHUB_ACTOR@users.noreply.github.com" | |
- name: Install Helm | |
uses: azure/setup-helm@v3 | |
with: | |
token: "${{ secrets.GITHUB_TOKEN }}" | |
- name: Run chart-releaser | |
uses: helm/chart-releaser-action@v1.5.0 | |
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/tibber-exporter/Chart.yaml >> $GITHUB_OUTPUT" | |
- name: Get go version | |
id: get_go_version | |
run: sed -n -E '/^FROM/ {s/^FROM golang:([0-9.]+).*/go_version=\1/p;q}' Dockerfile >> $GITHUB_OUTPUT | |
- uses: wangyoucao577/go-release-action@v1.37 | |
with: | |
github_token: ${{ secrets.GITHUB_TOKEN }} | |
goversion: ${{ steps.get_go_version.outputs.go_version }} | |
goos: ${{ matrix.goos }} | |
goarch: ${{ matrix.goarch }} | |
asset_name: "tibber-exporter-${{ steps.get_version.outputs.version }}-${{ matrix.goos }}-${{ matrix.goarch }}" | |
release_tag: "tibber-exporter-${{ steps.get_version.outputs.version }}" | |
md5sum: false | |
ldflags: "-X 'main.userAgent=tibber-exporter/${{ steps.get_version.outputs.version }} (${{ github.server_url}}/${{ github.repository }})'" |