plentico / plenti

Static Site Generator with Go backend and Svelte frontend
https://plenti.co
Apache License 2.0
985 stars 50 forks source link

Failing build: Credentials are no longer valid for the Snap Store #284

Closed jimafisk closed 1 year ago

jimafisk commented 1 year ago

Latest build failed: https://github.com/plentico/plenti/actions/runs/5164383127/jobs/9303243067

error=snapcraft packages: failed to publish artifacts: failed to push dist/plenti_0.6.14_linux_amd64.snap package: exit status 1: Starting Snapcraft 7.3.2
Logging execution to '/home/runner/.local/state/snapcraft/log/snapcraft-20230603-152831.568247.log'
Credentials are no longer valid for the Snap Store.
Recommended resolution: Run snapcraft login or export-login to obtain new credentials.
For more information, check out: https://snapcraft.io/docs/snapcraft-authentication
Full execution log: '/home/runner/.local/state/snapcraft/log/snapcraft-20230603-152831.568247.log'
jimafisk commented 1 year ago

Re-exported snapcraft credentials locally per https://github.com/plentico/plenti/issues/192#issuecomment-1143002099:

snapcraft export-login --snaps plenti -

Then on GitHub, went to: settings > security > secrets and variables > actions > repository secrets and updated SNAPCRAFT_TOKEN

Then I tried to re-run the existing job and the "snapcraft login" step throws:

Starting Snapcraft 7.3.2
Logging execution to '/home/runner/.local/state/snapcraft/log/snapcraft-20230603-16052[8](https://github.com/plentico/plenti/actions/runs/5164383127/jobs/9303473048#step:6:9).113237.log'
--with is no longer supported, export the auth to the environment variable 'SNAPCRAFT_STORE_CREDENTIALS' instead
Cannot parse config: File contains no section headers.
file: '<string>', line: 1
'***\n'
Full execution log: '/home/runner/.local/state/snapcraft/log/snapcraft-20230603-160528.[11](https://github.com/plentico/plenti/actions/runs/5164383127/jobs/9303473048#step:6:12)3237.log'
Error: Process completed with exit code 1.
jimafisk commented 1 year ago

Looks like we're using syntax only support by snapcraft 6.x so we should upgrade to newer syntax supported by 7.x:

jimafisk commented 1 year ago

New failure (Ensure the keyring is working or SNAPCRAFT_STORE_CREDENTIALS is correctly exported into the environment):

⨯ release failed after 3m2s                error=snapcraft packages: failed to publish artifacts: failed to push dist/plenti_0.6.15_linux_amd64.snap package: exit status 1: Starting Snapcraft 7.3.2
Logging execution to '/home/runner/.local/state/snapcraft/log/snapcraft-20230603-163444.111833.log'
craft-store error: No keyring found to store or retrieve credentials from.
Recommended resolution: Ensure the keyring is working or SNAPCRAFT_STORE_CREDENTIALS is correctly exported into the environment
For more information, check out: https://snapcraft.io/docs/snapcraft-authentication
Full execution log: '/home/runner/.local/state/snapcraft/log/snapcraft-20230603-163444.111833.log'

Error: The process '/opt/hostedtoolcache/goreleaser-action/1.18.2/x64/goreleaser' failed with exit code 1
jimafisk commented 1 year ago

The fix was just to set SNAPCRAFT_STORE_CREDENTIALS: ${{ secrets.snapcraft_token }} directly in the step where we're calling Goreleaser and eliminating the "Snapcraft Login" step we were using previously.