|
1 | 1 | name: Nightly Build
|
2 | 2 |
|
3 |
| -env: |
4 |
| - GO_VERSION: ^1.23 |
5 |
| - |
6 | 3 | on:
|
7 | 4 | schedule: # runs on the default branch: master
|
8 | 5 | - cron: "0 2 * * *" # run at 2 AM UTC
|
@@ -62,14 +59,59 @@ jobs:
|
62 | 59 | - name: Setup Buildx
|
63 | 60 | uses: docker/setup-buildx-action@v3
|
64 | 61 |
|
| 62 | + - name: Define tags |
| 63 | + id: meta |
| 64 | + uses: docker/metadata-action@v5 |
| 65 | + with: |
| 66 | + images: evcc/evcc |
| 67 | + tags: | |
| 68 | + type=raw,value=nightly |
| 69 | + type=raw,value=nightly.{{date 'YYYYMMDD'}}-{{sha}} |
| 70 | +
|
65 | 71 | - name: Publish
|
66 | 72 | uses: docker/build-push-action@v6
|
67 | 73 | with:
|
68 | 74 | context: .
|
69 | 75 | platforms: linux/amd64,linux/arm64,linux/arm/v6
|
70 | 76 | push: true
|
71 |
| - tags: | |
72 |
| - evcc/evcc:nightly |
| 77 | + tags: ${{ steps.meta.outputs.tags }} |
| 78 | + |
| 79 | + - name: Delete old nightly.* tags |
| 80 | + run: | |
| 81 | + old_tags=$(curl -s "https://hub.docker.com/v2/repositories/evcc/evcc/tags/?page_size=100" | jq -r '.results | map(select(.name | startswith("nightly."))) | sort_by(.last_updated) | reverse | .[1:] | .[].name') |
| 82 | + for tag in $old_tags; do |
| 83 | + echo "Deleting tag: $tag" |
| 84 | + curl -s -H "Authorization: Bearer ${{ secrets.DOCKER_PASS }}" -X DELETE "https://hub.docker.com/v2/repositories/evcc/evcc/tags/$tag/" |
| 85 | + done |
| 86 | +
|
| 87 | + hassio: |
| 88 | + name: Hassio Addon :nightly |
| 89 | + needs: |
| 90 | + - docker |
| 91 | + runs-on: ubuntu-latest |
| 92 | + |
| 93 | + steps: |
| 94 | + - name: Checkout |
| 95 | + uses: actions/checkout@master |
| 96 | + with: |
| 97 | + repository: evcc-io/hassio-addon |
| 98 | + token: ${{ secrets.GH_TOKEN }} |
| 99 | + path: ./hassio |
| 100 | + |
| 101 | + - name: Update version |
| 102 | + run: | |
| 103 | + current_date=$(date +%Y%m%d) |
| 104 | + short_sha=$(echo "${{ github.sha }}" | cut -c 1-7) |
| 105 | + sed -i -e "s/version:.*/version: nightly.${current_date}-${short_sha}/" ./hassio/evcc-nightly/config.yaml |
| 106 | +
|
| 107 | + - name: Push |
| 108 | + run: | |
| 109 | + cd ./hassio |
| 110 | + git add . |
| 111 | + git config user.name github-actions |
| 112 | + git config user.email [email protected] |
| 113 | + git commit -am "Mirror evcc nightly release" |
| 114 | + git push |
73 | 115 |
|
74 | 116 | apt:
|
75 | 117 | name: Publish APT nightly
|
|
83 | 125 | fetch-depth: 0
|
84 | 126 |
|
85 | 127 | - uses: actions/setup-go@v5
|
86 |
| - with: |
87 |
| - go-version: ${{ env.GO_VERSION }} |
88 | 128 | id: go
|
89 | 129 |
|
90 | 130 | - name: Patch ASN1
|
|
0 commit comments