mirror of
https://github.com/chidiwilliams/buzz.git
synced 2024-06-07 10:42:12 +02:00
67 lines
1.6 KiB
YAML
67 lines
1.6 KiB
YAML
---
|
|
name: Snapcraft
|
|
on:
|
|
push:
|
|
branches:
|
|
- main
|
|
tags:
|
|
- "*"
|
|
pull_request:
|
|
|
|
concurrency:
|
|
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
|
|
cancel-in-progress: true
|
|
|
|
jobs:
|
|
build:
|
|
runs-on: ubuntu-latest
|
|
outputs:
|
|
snap: ${{ steps.snapcraft.outputs.snap }}
|
|
steps:
|
|
- uses: actions/checkout@v3
|
|
with:
|
|
submodules: recursive
|
|
- uses: snapcore/action-build@v1
|
|
id: snapcraft
|
|
- run: |
|
|
sudo apt-get update
|
|
sudo apt-get install libportaudio2
|
|
- run: sudo snap install --devmode *.snap
|
|
- run: |
|
|
cd $HOME
|
|
xvfb-run buzz --version
|
|
- uses: actions/upload-artifact@v3
|
|
with:
|
|
name: snap
|
|
path: ${{ steps.snapcraft.outputs.snap }}
|
|
|
|
upload-edge:
|
|
runs-on: ubuntu-latest
|
|
needs: [ build ]
|
|
if: github.ref == 'refs/heads/main'
|
|
steps:
|
|
- uses: actions/download-artifact@v3
|
|
with:
|
|
name: snap
|
|
- uses: snapcore/action-publish@v1
|
|
env:
|
|
SNAPCRAFT_STORE_CREDENTIALS: ${{ secrets.SNAPCRAFT_TOKEN }}
|
|
with:
|
|
snap: ${{ needs.build.outputs.snap }}
|
|
release: edge
|
|
|
|
upload-stable:
|
|
runs-on: ubuntu-latest
|
|
needs: [ build ]
|
|
if: startsWith(github.ref, 'refs/tags/')
|
|
steps:
|
|
- uses: actions/download-artifact@v3
|
|
with:
|
|
name: snap
|
|
- uses: snapcore/action-publish@v1
|
|
env:
|
|
SNAPCRAFT_STORE_CREDENTIALS: ${{ secrets.SNAPCRAFT_TOKEN }}
|
|
with:
|
|
snap: ${{ needs.build.outputs.snap }}
|
|
release: stable
|