diff --git a/.github/workflows/release-nightly-snapcraft.yml b/.github/workflows/release-nightly-snapcraft.yml index f89654e40b..f351f561c7 100644 --- a/.github/workflows/release-nightly-snapcraft.yml +++ b/.github/workflows/release-nightly-snapcraft.yml @@ -13,21 +13,23 @@ jobs: build-and-publish: runs-on: ubuntu-latest - env: - SNAPCRAFT_STORE_CREDENTIALS: ${{ secrets.SNAPCRAFT_STORE_CREDENTIALS }} - steps: - uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7 - name: Install snapcraft run: sudo snap install snapcraft --classic - - name: Authenticate snapcraft - shell: bash - run: snapcraft login --with <(printf '%s' "$SNAPCRAFT_STORE_CREDENTIALS") - - name: Remote build + # remote-build runs on Launchpad and authenticates via a credentials file, + # not the Snap Store credentials used by upload + shell: bash + env: + LAUNCHPAD_CREDENTIALS: ${{ secrets.LAUNCHPAD_CREDENTIALS }} run: | + set -euo pipefail + install -d -m 700 "$HOME/.local/share/snapcraft" + printf '%s' "$LAUNCHPAD_CREDENTIALS" > "$HOME/.local/share/snapcraft/launchpad-credentials" + chmod 600 "$HOME/.local/share/snapcraft/launchpad-credentials" snapcraft remote-build \ --launchpad-accept-public-upload \ --build-for=amd64,arm64,armhf @@ -36,6 +38,8 @@ jobs: run: find . -maxdepth 1 -type f -name '*.snap' -print - name: Upload and release snapcraft nightly build + env: + SNAPCRAFT_STORE_CREDENTIALS: ${{ secrets.SNAPCRAFT_STORE_CREDENTIALS }} run: | set -euo pipefail