This repository was archived by the owner on May 23, 2026. It is now read-only.
Repository navigation
Upload Release Assets #55
This file contains hidden or 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: Upload Release Assets | |
| on: | |
| release: | |
| types: [published, edited] | |
| workflow_dispatch: | |
| inputs: | |
| tag: | |
| description: 'Release tag to upload assets to' | |
| required: true | |
| type: string | |
| permissions: | |
| contents: write | |
| jobs: | |
| upload-assets: | |
| name: Upload assets to release | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| with: | |
| ref: main | |
| - name: Setup Node and Yarn | |
| uses: volta-cli/action@v4 | |
| - name: Install dependencies | |
| run: | | |
| set +e | |
| yarn install --immutable | |
| if [ $? -ne 0 ]; then | |
| echo "Lockfile mismatch detected. Removing lockfile and reinstalling..." | |
| rm -f yarn.lock | |
| touch yarn.lock | |
| yarn install --mode=update-lockfile | |
| yarn install | |
| fi | |
| set -e | |
| - name: Build the files | |
| run: yarn run build | |
| - name: Zip the files | |
| uses: thedoctor0/zip-release@0.7.6 | |
| with: | |
| type: zip | |
| path: dist | |
| filename: advanced-camera-card.zip | |
| - name: Upload JS files to release | |
| uses: svenstaro/upload-release-action@2.9.0 | |
| with: | |
| repo_token: ${{ secrets.GITHUB_TOKEN }} | |
| file: dist/*.js | |
| file_glob: true | |
| tag: ${{ github.event.inputs.tag || github.event.release.tag_name }} | |
| overwrite: true | |
| - name: Upload Zip file to release | |
| uses: svenstaro/upload-release-action@2.9.0 | |
| with: | |
| repo_token: ${{ secrets.GITHUB_TOKEN }} | |
| file: advanced-camera-card.zip | |
| tag: ${{ github.event.inputs.tag || github.event.release.tag_name }} | |
| overwrite: true | |
| - name: HACS release validation | |
| uses: hacs/action@22.5.0 | |
| with: | |
| category: plugin | |