Try fromJSON hack #1
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Build default branch and PRs, publish only from default. | |
# Needs `STORE_LOGIN` configured https://github.com/snapcore/action-publish#store-login | |
# Change channel from default `edge` if needed. | |
name: Build and pubish snap package | |
on: | |
push: | |
branches: [ "main" ] | |
pull_request: | |
branches: [ "main" ] | |
jobs: | |
build-and-publish: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- id: build | |
uses: snapcore/action-build@v1 | |
#with: | |
# path: path-to-snapcraft-project | |
- id: publish | |
if: github.ref == format('refs/heads/{0}', fromJSON('"main"')) | |
uses: snapcore/action-publish@v1 | |
env: | |
SNAPCRAFT_STORE_CREDENTIALS: ${{ secrets.STORE_LOGIN }} | |
with: | |
snap: ${{ steps.build.outputs.snap }} | |
release: stable |