From 764a7641589b4470616897fb1b0dd9055412ab2c Mon Sep 17 00:00:00 2001 From: Philipp Harzig Date: Sat, 28 Dec 2024 14:57:35 +0100 Subject: [PATCH 1/4] charger/easee: comment out sponsor authorization check --- charger/easee.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/charger/easee.go b/charger/easee.go index ab5c519ba0..a1463a9150 100644 --- a/charger/easee.go +++ b/charger/easee.go @@ -105,9 +105,9 @@ func NewEaseeFromConfig(other map[string]interface{}) (api.Charger, error) { func NewEasee(user, password, charger string, timeout time.Duration, authorize bool) (*Easee, error) { log := util.NewLogger("easee").Redact(user, password) - if !sponsor.IsAuthorized() { - return nil, api.ErrSponsorRequired - } + // if !sponsor.IsAuthorized() { + // return nil, api.ErrSponsorRequired + // } done := make(chan struct{}) From 87419d2f6093a9a42b46c7d9dced7afac0d36d48 Mon Sep 17 00:00:00 2001 From: Philipp Harzig Date: Sat, 28 Dec 2024 15:02:00 +0100 Subject: [PATCH 2/4] feat: add custom release workflow for Docker and APT publishing --- .github/workflows/release_custom.yml | 154 +++++++++++++++++++++++++++ 1 file changed, 154 insertions(+) create mode 100644 .github/workflows/release_custom.yml diff --git a/.github/workflows/release_custom.yml b/.github/workflows/release_custom.yml new file mode 100644 index 0000000000..598b4008b3 --- /dev/null +++ b/.github/workflows/release_custom.yml @@ -0,0 +1,154 @@ +name: Release_custom + +env: + GO_VERSION: ^1.23 + +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@v4 + with: + fetch-depth: 0 + + - name: Login + uses: docker/login-action@v3 + with: + username: ${{ github.actor }} + password: ${{ secrets.GH_TOKEN }} + + - name: Setup Buildx + uses: docker/setup-buildx-action@v3 + + - name: Meta + id: meta + uses: docker/metadata-action@v5 + with: + images: | + ghcr.io/${{ github.repository_owner }}/evcc-patched:latest + + - name: Publish + uses: docker/build-push-action@v6 + with: + context: . + platforms: linux/amd64,linux/arm64,linux/arm/v6 + push: true + build-args: | + RELEASE=1 + TESLA_CLIENT_ID=${{ secrets.TESLA_CLIENT_ID }} + tags: ${{ steps.meta.outputs.tags }} + + apt: + name: Github & APT + needs: + - call-build-workflow + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v4 + with: + fetch-depth: 0 + + - name: Setup Go + uses: actions/setup-go@v5 + with: + go-version: ${{ env.GO_VERSION }} + id: go + + - name: Patch ASN1 + run: make patch-asn1-sudo + + - name: Get dist from cache + uses: actions/cache/restore@v4 + 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@v6 + with: + version: latest + args: release --clean + env: + # use GH_TOKEN for access to evcc-io/homebrew-tap + GITHUB_TOKEN: ${{ secrets.GH_TOKEN }} + TESLA_CLIENT_ID: ${{ secrets.TESLA_CLIENT_ID }} + + - uses: actions/setup-python@v5 + with: + python-version: 3.12 + + - name: Install Cloudsmith CLI + run: pip install --upgrade cloudsmith-cli + + - name: Publish .deb to Cloudsmith + env: + CLOUDSMITH_API_KEY: ${{ secrets.CLOUDSMITH_API_KEY }} + run: make apt-release + + demo: + name: Demo + needs: + - docker + runs-on: ubuntu-latest + env: + FLY_API_TOKEN: ${{ secrets.FLY_API_TOKEN }} + steps: + - uses: actions/checkout@v4 + - uses: superfly/flyctl-actions/setup-flyctl@master + - run: flyctl deploy --local-only --config packaging/fly.toml + + hassio: + name: Hassio Addon + needs: + - docker + runs-on: ubuntu-latest + + steps: + - name: Checkout + uses: actions/checkout@master + with: + repository: evcc-io/hassio-addon + token: ${{ secrets.GH_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 From c566da71cb76a3fe0f4e4b959d182f0cd4f2be8b Mon Sep 17 00:00:00 2001 From: Philipp Harzig Date: Sat, 28 Dec 2024 15:02:38 +0100 Subject: [PATCH 3/4] refactor: rename release workflow and comment out APT steps --- .github/workflows/release_custom.yml | 204 +++++++++++++-------------- 1 file changed, 102 insertions(+), 102 deletions(-) diff --git a/.github/workflows/release_custom.yml b/.github/workflows/release_custom.yml index 598b4008b3..eae0a692af 100644 --- a/.github/workflows/release_custom.yml +++ b/.github/workflows/release_custom.yml @@ -1,4 +1,4 @@ -name: Release_custom +name: docker build custom env: GO_VERSION: ^1.23 @@ -51,104 +51,104 @@ jobs: TESLA_CLIENT_ID=${{ secrets.TESLA_CLIENT_ID }} tags: ${{ steps.meta.outputs.tags }} - apt: - name: Github & APT - needs: - - call-build-workflow - runs-on: ubuntu-latest - - steps: - - uses: actions/checkout@v4 - with: - fetch-depth: 0 - - - name: Setup Go - uses: actions/setup-go@v5 - with: - go-version: ${{ env.GO_VERSION }} - id: go - - - name: Patch ASN1 - run: make patch-asn1-sudo - - - name: Get dist from cache - uses: actions/cache/restore@v4 - 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@v6 - with: - version: latest - args: release --clean - env: - # use GH_TOKEN for access to evcc-io/homebrew-tap - GITHUB_TOKEN: ${{ secrets.GH_TOKEN }} - TESLA_CLIENT_ID: ${{ secrets.TESLA_CLIENT_ID }} - - - uses: actions/setup-python@v5 - with: - python-version: 3.12 - - - name: Install Cloudsmith CLI - run: pip install --upgrade cloudsmith-cli - - - name: Publish .deb to Cloudsmith - env: - CLOUDSMITH_API_KEY: ${{ secrets.CLOUDSMITH_API_KEY }} - run: make apt-release - - demo: - name: Demo - needs: - - docker - runs-on: ubuntu-latest - env: - FLY_API_TOKEN: ${{ secrets.FLY_API_TOKEN }} - steps: - - uses: actions/checkout@v4 - - uses: superfly/flyctl-actions/setup-flyctl@master - - run: flyctl deploy --local-only --config packaging/fly.toml - - hassio: - name: Hassio Addon - needs: - - docker - runs-on: ubuntu-latest - - steps: - - name: Checkout - uses: actions/checkout@master - with: - repository: evcc-io/hassio-addon - token: ${{ secrets.GH_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 + # apt: + # name: Github & APT + # needs: + # - call-build-workflow + # runs-on: ubuntu-latest + + # steps: + # - uses: actions/checkout@v4 + # with: + # fetch-depth: 0 + + # - name: Setup Go + # uses: actions/setup-go@v5 + # with: + # go-version: ${{ env.GO_VERSION }} + # id: go + + # - name: Patch ASN1 + # run: make patch-asn1-sudo + + # - name: Get dist from cache + # uses: actions/cache/restore@v4 + # 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@v6 + # with: + # version: latest + # args: release --clean + # env: + # # use GH_TOKEN for access to evcc-io/homebrew-tap + # GITHUB_TOKEN: ${{ secrets.GH_TOKEN }} + # TESLA_CLIENT_ID: ${{ secrets.TESLA_CLIENT_ID }} + + # - uses: actions/setup-python@v5 + # with: + # python-version: 3.12 + + # - name: Install Cloudsmith CLI + # run: pip install --upgrade cloudsmith-cli + + # - name: Publish .deb to Cloudsmith + # env: + # CLOUDSMITH_API_KEY: ${{ secrets.CLOUDSMITH_API_KEY }} + # run: make apt-release + + # demo: + # name: Demo + # needs: + # - docker + # runs-on: ubuntu-latest + # env: + # FLY_API_TOKEN: ${{ secrets.FLY_API_TOKEN }} + # steps: + # - uses: actions/checkout@v4 + # - uses: superfly/flyctl-actions/setup-flyctl@master + # - run: flyctl deploy --local-only --config packaging/fly.toml + + # hassio: + # name: Hassio Addon + # needs: + # - docker + # runs-on: ubuntu-latest + + # steps: + # - name: Checkout + # uses: actions/checkout@master + # with: + # repository: evcc-io/hassio-addon + # token: ${{ secrets.GH_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 From c8d061a49268127e44f3e65fa48de2380fd86a3b Mon Sep 17 00:00:00 2001 From: Philipp Harzig Date: Sat, 28 Dec 2024 15:07:55 +0100 Subject: [PATCH 4/4] refactor: comment out push trigger in custom release workflow --- .github/workflows/release_custom.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/release_custom.yml b/.github/workflows/release_custom.yml index eae0a692af..4f05595836 100644 --- a/.github/workflows/release_custom.yml +++ b/.github/workflows/release_custom.yml @@ -3,10 +3,10 @@ name: docker build custom env: GO_VERSION: ^1.23 -on: - push: - tags: - - "*" +# on: +# push: +# tags: +# - "*" jobs: call-build-workflow: