145 lines
3.6 KiB
YAML
145 lines
3.6 KiB
YAML
name: Nightly Build
|
|
permissions:
|
|
contents: read
|
|
|
|
on:
|
|
schedule: # runs on the default branch: master
|
|
- cron: "0 2 * * *" # run at 2 AM UTC
|
|
workflow_dispatch:
|
|
|
|
jobs:
|
|
check_date:
|
|
runs-on: depot-ubuntu-24.04-arm
|
|
name: Check latest commit
|
|
|
|
permissions:
|
|
contents: read
|
|
outputs:
|
|
should_run: ${{ steps.should_run.outputs.should_run }}
|
|
steps:
|
|
- uses: actions/checkout@v7
|
|
with:
|
|
persist-credentials: false
|
|
- 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
|
|
permissions:
|
|
contents: read
|
|
actions: write
|
|
|
|
docker:
|
|
needs:
|
|
- call-build-workflow
|
|
uses: ./.github/workflows/nightly-docker.yml
|
|
permissions:
|
|
contents: read
|
|
actions: read
|
|
id-token: write # depot OIDC
|
|
secrets: inherit
|
|
|
|
hassio:
|
|
name: Hassio Addon :nightly
|
|
needs:
|
|
- docker
|
|
runs-on: depot-ubuntu-24.04-arm
|
|
|
|
permissions:
|
|
contents: read
|
|
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v7
|
|
with:
|
|
repository: evcc-io/hassio-addon
|
|
token: ${{ secrets.HASSIO_DEPLOY_TOKEN }}
|
|
path: ./hassio
|
|
|
|
- name: Update version
|
|
run: |
|
|
current_date=$(date +%Y%m%d)
|
|
short_sha=$(echo "${{ github.sha }}" | cut -c 1-7)
|
|
sed -i -e "s/version:.*/version: nightly.${current_date}-${short_sha}/" ./hassio/evcc-nightly/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 nightly release"
|
|
git push
|
|
|
|
hassio-changelog:
|
|
name: Update Hassio Nightly Changelog
|
|
needs:
|
|
- hassio
|
|
uses: ./.github/workflows/hassio-changelog.yml
|
|
with:
|
|
addon_path: evcc-nightly
|
|
include_unreleased: true
|
|
secrets: inherit
|
|
|
|
apt:
|
|
name: Publish APT nightly
|
|
needs:
|
|
- call-build-workflow
|
|
runs-on: depot-ubuntu-24.04-arm
|
|
|
|
permissions:
|
|
contents: read
|
|
actions: read
|
|
|
|
steps:
|
|
- uses: actions/checkout@v7
|
|
with:
|
|
fetch-depth: 0
|
|
persist-credentials: false
|
|
|
|
- uses: actions/setup-go@v7
|
|
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@v6
|
|
id: cache-dist
|
|
with:
|
|
path: dist
|
|
key: ${{ runner.os }}-${{ github.sha }}-dist
|
|
|
|
- name: Create nightly build
|
|
uses: goreleaser/goreleaser-action@f06c13b6b1a9625abc9e6e439d9c05a8f2190e94 # v7
|
|
with:
|
|
version: '~> v2'
|
|
args: --snapshot -f .goreleaser-nightly.yml --clean
|
|
env:
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_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-nightly
|