evcc-io/.github/workflows/release.yml
2022-09-11 11:51:13 +02:00

120 lines
3.1 KiB
YAML

name: Release
on:
push:
tags:
- "*"
jobs:
call-build-workflow:
if: "startsWith(github.ref, 'refs/tags')"
uses: evcc-io/evcc/.github/workflows/default.yml@master
docker:
name: Publish Docker :release
needs:
- call-build-workflow
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
ref: refs/heads/master # force master
fetch-depth: 0
- name: Login
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKER_USER }}
password: ${{ secrets.DOCKER_PASS }}
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Publish
uses: docker/build-push-action@v3
with:
context: .
platforms: linux/amd64,linux/arm64,linux/arm/v6
push: true
build-args: |
RELEASE=1
tags: |
andig/evcc:latest
apt:
name: Publish Github & APT release
needs:
- call-build-workflow
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Setup Go
uses: actions/setup-go@v3
with:
go-version: ^1.18
cache: true
id: go
- name: Install Cloudsmith CLI
run: pip install --upgrade cloudsmith-cli
# gokrazy image
# - name: Prepare Image
# run: |
# make prepare-image
# sed -i -e 's#-ld.*$#& -X github.com/evcc-io/evcc/server/updater.Password=${{ secrets.IMAGE_PASS }}#' buildflags/github.com/evcc-io/evcc/buildflags.txt
# mkdir /home/runner/.config/gokrazy
# echo ${{ secrets.IMAGE_PASS }}> /home/runner/.config/gokrazy/http-password.txt
# - name: Build Image
# run: make image
# - name: Build Root Filesystem
# run: make image-rootfs
- name: Create Github Release
uses: goreleaser/goreleaser-action@v3
with:
version: latest
args: release --rm-dist
env:
# use GH_TOKEN for access to evcc-io/homebrew-tap
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}
- name: Publish .deb to Cloudsmith
env:
CLOUDSMITH_API_KEY: ${{ secrets.CLOUDSMITH_API_KEY }}
run: make apt-release
hassio:
name: Create Hassio Addon Release
needs:
- docker
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Update version
# uses: pocket-apps/action-update-version@v1
# with:
# files: "packaging/hassio/config.json"
# version-regexp: '\d+.\d+.\d+'
# branch-name: master
# author-name: evcc-io
run: |
sed -i -e s#0.0.0#$(echo ${{ env.GITHUB_REF }} | sed -e s#refs/tags/##)# packaging/hassio/config.json
- name: Copy config to hassio-addon
uses: andstor/copycat-action@v3
with:
personal_token: ${{ secrets.GH_TOKEN }}
src_path: packaging/hassio/config.json
dst_path: /evcc/config.json
dst_owner: evcc-io
dst_repo_name: hassio-addon