diff --git a/.github/workflows/build_and_publish.yml b/.github/workflows/build_and_publish.yml new file mode 100644 index 0000000..6e0706d --- /dev/null +++ b/.github/workflows/build_and_publish.yml @@ -0,0 +1,42 @@ +name: Build and Publish + +on: + workflow_dispatch: # Only enable manual runs for now + +jobs: + build: + runs-on: ubuntu-latest + steps: + # Step 1: Checkout the repository + - name: Checkout repository + uses: actions/checkout@v4 + + # Step 2: Prepare Build Environment + - name: Prepare Environment + run: | + bash build.sh --just-prepare + + # Step 3: Set up Snapcraft + - name: Set up Snapcraft + uses: snapcore/action-build@v1 + id: build + with: + snapcraft-channel: stable + + # Step 4: Validate the built Snap + - name: Validate Snap + uses: diddlesnaps/snapcraft-review-action@v1 + with: + snap: ${{ steps.build.outputs.snap }} + isClassic: 'false' + + # Step 5: Publish Snap + - name: Publish Snap Package + uses: snapcore/action-publish@v1 + env: + SNAPCRAFT_STORE_CREDENTIALS: ${{ secrets.STORE_LOGIN }} + with: + snap: ${{needs.build.outputs.snap-file}} + release: stable + with: + snap: ''