172 lines
4.3 KiB
YAML
172 lines
4.3 KiB
YAML
name: Release
|
|
|
|
permissions:
|
|
contents: read
|
|
|
|
on:
|
|
push:
|
|
tags:
|
|
- "*"
|
|
|
|
jobs:
|
|
call-build-workflow:
|
|
if: startsWith(github.ref, 'refs/tags')
|
|
uses: evcc-io/evcc/.github/workflows/default.yml@master
|
|
permissions:
|
|
contents: read
|
|
actions: write
|
|
|
|
docker:
|
|
name: Publish Docker :release
|
|
needs:
|
|
- call-build-workflow
|
|
runs-on: depot-ubuntu-24.04-arm
|
|
permissions:
|
|
contents: read
|
|
|
|
steps:
|
|
- uses: actions/checkout@v6
|
|
with:
|
|
fetch-depth: 0
|
|
persist-credentials: false
|
|
|
|
- name: Login
|
|
uses: docker/login-action@4907a6ddec9925e35a0a9e82d7399ccc52663121 # v4
|
|
with:
|
|
username: ${{ secrets.DOCKER_USER }}
|
|
password: ${{ secrets.DOCKER_PASS }}
|
|
|
|
- name: Setup Buildx
|
|
uses: docker/setup-buildx-action@4d04d5d9486b7bd6fa91e7baf45bbb4f8b9deedd # v4
|
|
|
|
- name: Meta
|
|
id: meta
|
|
uses: docker/metadata-action@030e881283bb7a6894de51c315a6bfe6a94e05cf # v6
|
|
with:
|
|
images: |
|
|
evcc/evcc
|
|
|
|
- name: Publish
|
|
uses: docker/build-push-action@bcafcacb16a39f128d818304e6c9c0c18556b85f # v7
|
|
with:
|
|
context: .
|
|
platforms: linux/amd64,linux/arm64,linux/arm/v6
|
|
push: true
|
|
build-args: |
|
|
RELEASE=1
|
|
tags: ${{ steps.meta.outputs.tags }}
|
|
|
|
apt:
|
|
name: Github & APT
|
|
needs:
|
|
- call-build-workflow
|
|
runs-on: depot-ubuntu-24.04-arm
|
|
|
|
permissions:
|
|
contents: write
|
|
actions: read
|
|
|
|
steps:
|
|
- uses: actions/checkout@v6
|
|
with:
|
|
fetch-depth: 0
|
|
persist-credentials: false
|
|
|
|
- name: Setup Go
|
|
uses: actions/setup-go@v6
|
|
with:
|
|
go-version-file: go.mod
|
|
id: go
|
|
|
|
- name: Patch ASN1
|
|
run: make patch-asn1-sudo
|
|
|
|
- name: Get dist from cache
|
|
uses: actions/cache/restore@v5
|
|
id: cache-dist
|
|
with:
|
|
path: dist
|
|
key: ${{ runner.os }}-${{ github.sha }}-dist
|
|
|
|
# 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@1a80836c5c9d9e5755a25cb59ec6f45a3b5f41a8 # v7
|
|
with:
|
|
version: '~> v2'
|
|
args: release --clean
|
|
env:
|
|
# use RELEASE_DEPLOY_TOKEN for access to evcc-io/homebrew-tap
|
|
GITHUB_TOKEN: ${{ secrets.RELEASE_DEPLOY_TOKEN }}
|
|
|
|
- uses: actions/setup-python@v6
|
|
with:
|
|
python-version: 3.12
|
|
|
|
- name: Install Cloudsmith CLI
|
|
run: pip install cloudsmith-cli==1.16.0
|
|
|
|
- name: Publish .deb to Cloudsmith
|
|
env:
|
|
CLOUDSMITH_API_KEY: ${{ secrets.CLOUDSMITH_API_KEY }}
|
|
run: make apt-release
|
|
|
|
demo:
|
|
name: Demo
|
|
needs:
|
|
- docker
|
|
runs-on: depot-ubuntu-24.04-arm
|
|
|
|
permissions:
|
|
contents: read
|
|
|
|
env:
|
|
FLY_API_TOKEN: ${{ secrets.FLY_API_TOKEN }}
|
|
steps:
|
|
- uses: actions/checkout@v6
|
|
with:
|
|
persist-credentials: false
|
|
- uses: superfly/flyctl-actions/setup-flyctl@ed8efb33836e8b2096c7fd3ba1c8afe303ebbff1 # master
|
|
- run: flyctl deploy --local-only --config packaging/fly.toml
|
|
|
|
hassio:
|
|
name: Hassio Addon
|
|
needs:
|
|
- docker
|
|
runs-on: depot-ubuntu-24.04-arm
|
|
|
|
permissions:
|
|
contents: read
|
|
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v6
|
|
with:
|
|
repository: evcc-io/hassio-addon
|
|
token: ${{ secrets.HASSIO_DEPLOY_TOKEN }}
|
|
path: ./hassio
|
|
|
|
- name: Update version
|
|
run: |
|
|
sed -i -e s#version.*#version\:\ $(echo ${{ github.ref }} | sed -e s#refs/tags/##)# ./hassio/evcc/config.yaml
|
|
|
|
- name: Push
|
|
run: |
|
|
cd ./hassio
|
|
git add .
|
|
git config user.name github-actions
|
|
git config user.email github-actions@github.com
|
|
git commit -am "Mirror evcc release"
|
|
git push
|