From bdc6a2da594b9b165532ad6b28eb18dc69ca4c14 Mon Sep 17 00:00:00 2001 From: Rafael Araujo Lehmkuhl Date: Thu, 10 Oct 2024 16:56:20 -0300 Subject: [PATCH] ci: Publish `latest.yml` for Electron auto-updates --- .github/workflows/ci.yml | 32 ++++++++++++++++++++++++++++---- 1 file changed, 28 insertions(+), 4 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 53659d116..76d24946b 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -107,31 +107,44 @@ jobs: - name: Bun deploy (arm) if: matrix.os == 'ubuntu-24-arm' run: | - SNAPCRAFT_BUILD_ENVIRONMENT="host" bun deploy:electron + SNAPCRAFT_BUILD_ENVIRONMENT="host" bun deploy:electron -c.extraMetadata.version=1.1.9 - name: Bun deploy (others) if: matrix.os != 'ubuntu-24-arm' run: | - bun deploy:electron + bun deploy:electron -c.extraMetadata.version=1.1.9 - name: Build artifact name if: "!startsWith(github.ref, 'refs/tags/') && success()" run: | + ls -la dist mv dist/Cockpit*.${{ matrix.extension }} dist/Cockpit-${{ matrix.suffix }}-$(git describe --tags).${{ matrix.extension }} + mv dist/latest*.yml dist/latest-${{ matrix.suffix }}.yml + ls -la dist - name: Build tag name if: startsWith(github.ref, 'refs/tags/') && success() run: | + ls -la dist mv dist/Cockpit*.${{ matrix.extension }} dist/Cockpit-${{ matrix.suffix }}-$(git describe --tags --abbrev=0).${{ matrix.extension }} + mv dist/latest*.yml dist/latest-${{ matrix.suffix }}.yml + ls -la dist - - name: Upload Artifact + - name: Upload binary artifact uses: actions/upload-artifact@v3 with: name: cockpit-${{ matrix.suffix }} path: dist/Cockpit-${{ matrix.suffix }}-*.${{ matrix.extension }} if-no-files-found: error - - name: Upload Release + - name: Upload latest metadata artifact + uses: actions/upload-artifact@v3 + with: + name: cockpit-${{ matrix.suffix }} + path: dist/latest-${{ matrix.suffix }}.yml + if-no-files-found: error + + - name: Upload binary artifact uses: svenstaro/upload-release-action@v2 if: startsWith(github.ref, 'refs/tags/') && success() with: @@ -142,6 +155,17 @@ jobs: prerelease: true file_glob: true + - name: Upload latest metadata artifact + uses: svenstaro/upload-release-action@v2 + if: startsWith(github.ref, 'refs/tags/') && success() + with: + repo_token: ${{ secrets.GITHUB_TOKEN }} + file: dist/latest-${{ matrix.suffix }}.yml + tag: ${{ github.ref }} + overwrite: true + prerelease: true + file_glob: true + deploy-flatpak: needs: test runs-on: ${{ matrix.os }}