Skip to content

Commit

Permalink
Only login to snapcraft when secret is available in goreleaser workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
muesli committed Mar 28, 2021
1 parent 3ff9a5d commit ca833c7
Showing 1 changed file with 11 additions and 11 deletions.
22 changes: 11 additions & 11 deletions .github/workflows/goreleaser.yml
Expand Up @@ -8,26 +8,26 @@ jobs:
goreleaser:
runs-on: ubuntu-latest
steps:
-
name: Checkout
- name: Checkout
uses: actions/checkout@v2
with:
fetch-depth: 0
-
name: Set up Go
- name: Set up Go
uses: actions/setup-go@v2
with:
go-version: ~1.16
-
name: Set up Snapcraft
env:
SNAPCRAFT_LOGIN: ${{ secrets.SNAPCRAFT_LOGIN }}
- name: Set up Snapcraft
run: |
sudo apt-get update
sudo apt-get -yq --no-install-suggests --no-install-recommends install snapcraft
snapcraft login --with <(echo "$SNAPCRAFT_LOGIN")
-
name: Run GoReleaser
mkdir -p $HOME/.cache/snapcraft/download
mkdir -p $HOME/.cache/snapcraft/stage-packages
- name: Login Snapcraft
env:
SNAPCRAFT_LOGIN: ${{ secrets.SNAPCRAFT_LOGIN }}
if: env.SNAPCRAFT_LOGIN != null
run: snapcraft login --with <(echo "$SNAPCRAFT_LOGIN")
- name: Run GoReleaser
uses: goreleaser/goreleaser-action@v2
with:
version: latest
Expand Down

0 comments on commit ca833c7

Please sign in to comment.