Skip to content

Commit

Permalink
ci: Publish latest.yml for Electron auto-updates
Browse files Browse the repository at this point in the history
  • Loading branch information
rafaellehmkuhl committed Oct 10, 2024
1 parent 4683d3b commit bdc6a2d
Showing 1 changed file with 28 additions and 4 deletions.
32 changes: 28 additions & 4 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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 }}
Expand Down

0 comments on commit bdc6a2d

Please sign in to comment.