Nightly Build #1333
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: Nightly Build | |
env: | |
GO_VERSION: ^1.23 | |
on: | |
schedule: # runs on the default branch: master | |
- cron: "0 2 * * *" # run at 2 AM UTC | |
workflow_dispatch: | |
jobs: | |
check_date: | |
runs-on: ubuntu-latest | |
name: Check latest commit | |
outputs: | |
should_run: ${{ steps.should_run.outputs.should_run }} | |
steps: | |
- uses: actions/checkout@v4 | |
- name: print latest_commit | |
run: echo ${{ github.sha }} | |
- id: should_run | |
continue-on-error: true | |
name: check latest commit is less than a day | |
if: ${{ github.event_name == 'schedule' }} | |
run: test -z $(git rev-list --after="24 hours" ${{ github.sha }}) && echo "should_run=false" >> $GITHUB_OUTPUT | |
call-build-workflow: | |
name: Call Build | |
needs: check_date | |
if: | | |
${{ needs.check_date.outputs.should_run != 'false' }} | |
&& startsWith(github.ref, 'refs/heads/master') | |
&& ! contains(github.head_ref, 'refs/heads/chore/') | |
uses: evcc-io/evcc/.github/workflows/default.yml@master | |
docker: | |
name: Publish Docker :nightly | |
needs: | |
- call-build-workflow | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
ref: refs/heads/master # force master | |
fetch-depth: 0 | |
- name: Get dist from cache | |
uses: actions/cache/restore@v4 | |
id: cache-dist | |
with: | |
path: dist | |
key: ${{ runner.os }}-${{ github.sha }}-dist | |
- name: Login | |
uses: docker/login-action@v3 | |
with: | |
username: ${{ secrets.DOCKER_USER }} | |
password: ${{ secrets.DOCKER_PASS }} | |
- name: Setup Buildx | |
uses: docker/setup-buildx-action@v3 | |
- name: Publish | |
uses: docker/build-push-action@v6 | |
with: | |
context: . | |
platforms: linux/amd64,linux/arm64,linux/arm/v6 | |
push: true | |
build-args: | | |
TESLA_CLIENT_ID=${{ secrets.TESLA_CLIENT_ID }} | |
tags: | | |
evcc/evcc:nightly | |
apt: | |
name: Publish APT nightly | |
needs: | |
- call-build-workflow | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- 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 | |
- name: Create nightly build | |
uses: goreleaser/goreleaser-action@v6 | |
with: | |
version: latest | |
args: --snapshot -f .goreleaser-nightly.yml --clean | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_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-nightly |