diff --git a/.github/workflows/create-snap-action.yml b/.github/workflows/create-snap-action.yml index b0fa1038..bae1714c 100644 --- a/.github/workflows/create-snap-action.yml +++ b/.github/workflows/create-snap-action.yml @@ -17,6 +17,18 @@ on: jobs: + check-secret: + runs-on: ubuntu-22.04 + outputs: + snap-key: ${{ steps.snap-key.outputs.defined }} + steps: + - id: snap-key + name: Set defined=true if SNAPCRAFT7_CREDS is defined + if: "${{ env.SNAPSTORE_KEY != '' }}" + run: echo "defined=true" >> $GITHUB_OUTPUT + env: + SNAPSTORE_KEY: ${{ secrets.SNAPCRAFT7_CREDS }} + build: runs-on: ubuntu-22.04 steps: @@ -34,3 +46,12 @@ jobs: run: | sudo snap install checkbox22 sudo snap install --dangerous --classic ${{ steps.build.outputs.snap }} + + - if: needs.check-secret.outputs.snap-key == 'true' && (github.ref_name == 'noble-24.04') + name: Publish snap to edge channel + uses: snapcore/action-publish@v1.2.0 + env: + SNAPCRAFT_STORE_CREDENTIALS: ${{ secrets.SNAPCRAFT7_CREDS }} + with: + snap: ${{ steps.build.outputs.snap }} + release: edge diff --git a/tests/snap/snapcraft.yaml b/tests/snap/snapcraft.yaml index dc723d3e..de81a5eb 100644 --- a/tests/snap/snapcraft.yaml +++ b/tests/snap/snapcraft.yaml @@ -2,7 +2,7 @@ name: checkbox-tdx-classic summary: Checkbox tests for TDX description: | Collection of tests for Intel TDX (Trusted Domain eXtension) -version: '2.0' +version: '1.0.0' confinement: classic grade: stable