Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bump artifact actions to v4 #161

Closed
wants to merge 2 commits into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 15 additions & 14 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -74,13 +74,12 @@ jobs:
if: ${{ matrix.device != 'pico-w' }}
run: |
sed -i 's/${{ steps.esphome-build.outputs.name }}\//\/${{ matrix.firmware }}\/${{ matrix.device }}\//g' output/${{ matrix.device }}/manifest.json
- uses: actions/upload-artifact@v3.1.3
- uses: actions/upload-artifact@v4.3.1
with:
name: ${{ matrix.firmware }}
name: ${{ matrix.firmware }}-${{ matrix.device }}
path: output

combined-manifests:
if: (github.event_name == 'workflow_dispatch' || github.event_name == 'push') && github.ref == 'refs/heads/main'
name: Combine ${{ matrix.project }} manifests
runs-on: ubuntu-latest
needs: build
Expand All @@ -93,21 +92,21 @@ jobs:
- project: esphome-web
name: ESPHome Web
steps:
- uses: actions/download-artifact@v3
- uses: actions/download-artifact@v4.1.2
with:
name: ${{ matrix.project }}
pattern: ${{ matrix.project }}-*
path: files
merge-multiple: true
- name: Generate manifest.json
run: |
version=$(cat files/*/version | sort -V | tail -n 1)
jq -s --arg version "$version" '{"name": "${{ matrix.name }}", "version": $version, "home_assistant_domain": "esphome", "builds":.}' files/*/manifest.json > manifest.json
- uses: actions/upload-artifact@v3.1.3
- uses: actions/upload-artifact@v4.3.1
with:
name: ${{ matrix.project }}
name: ${{ matrix.project }}-manifest
path: manifest.json

full-manifests:
if: (github.event_name == 'workflow_dispatch' || github.event_name == 'push') && github.ref == 'refs/heads/main'
name: Create ${{ matrix.project }} manifest
runs-on: ubuntu-latest
needs: build
Expand All @@ -122,10 +121,11 @@ jobs:
- project: media-player
name: Media Player
steps:
- uses: actions/download-artifact@v3
- uses: actions/download-artifact@v4.1.2
with:
name: ${{ matrix.project }}
pattern: ${{ matrix.project }}-*
path: files
merge-multiple: true
- name: Generate manifest.json files
run: |
cd files
Expand All @@ -136,23 +136,24 @@ jobs:
jq --arg version "$version" '{"name": "${{ matrix.name }}", "version": $version, "home_assistant_domain": "esphome", "new_install_skip_erase": false, "builds":[.]}' manifest.json > ../../output/$device/manifest.json
popd
done
- uses: actions/upload-artifact@v3.1.3
- uses: actions/upload-artifact@v4.3.1
with:
name: ${{ matrix.project }}
name: ${{ matrix.project }}-manifests
path: output

consolidate:
if: (github.event_name == 'workflow_dispatch' || github.event_name == 'push') && github.ref == 'refs/heads/main'
name: Consolidate firmwares
runs-on: ubuntu-latest
needs:
- combined-manifests
- full-manifests
steps:
- uses: actions/checkout@v4
- uses: actions/download-artifact@v3
- uses: actions/download-artifact@v4.1.2
with:
path: output
merge-multiple: true

- run: cp -R static/* output/
- uses: actions/[email protected]
with:
Expand Down