Skip to content

Commit

Permalink
test|feat: upload artifact and try to use store_login field
Browse files Browse the repository at this point in the history
Signed-off-by: Lincoln Wallace <[email protected]>
  • Loading branch information
locnnil committed Aug 21, 2024
1 parent 1a63a49 commit 826a7b4
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion .github/workflows/store-publish.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,17 +16,26 @@ jobs:
PR_NUMBER: ${{ github.event.number }}
steps:
- name: Checkout code
uses: actions/checkout@v2
uses: actions/checkout@v4

- name: Build
uses: snapcore/action-build@v1
id: snapcraft
with:
snapcraft-args: snap --output docker-pr-${{ env.PR_NUMBER }}.snap

- name: Upload
# TODO the goal of this "if:" condition is to avoid creating artifacts on private forks (and using up all their storage quota), but Tianon couldn't find a clean way to do that so this was the next best thing
if: github.repository == 'canonical/docker-snap'
uses: actions/upload-artifact@v4
with:
name: docker-pr-${{ env.PR_NUMBER }}.snap
path: ${{ steps.snapcraft.outputs.snap }}

- uses: snapcore/action-publish@v1
env:
SNAPCRAFT_STORE_CREDENTIALS: ${{ secrets.SNAPCRAFT_LOGIN }}
with:
store_login: ${{ secrets.SNAPCRAFT_LOGIN }}
snap: ${{ steps.snapcraft.outputs.snap }}
release: latest/edge/pr-${{ env.PR_NUMBER }}

0 comments on commit 826a7b4

Please sign in to comment.