Skip to content

Commit

Permalink
Use script to determine snapcraft releases
Browse files Browse the repository at this point in the history
  • Loading branch information
FirelightFlagboy committed Jul 15, 2024
1 parent 1deb169 commit 9e7b0b7
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 1 deletion.
22 changes: 21 additions & 1 deletion .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,22 @@ on:
type: string
required: true
description: The release tag to fetch the package to publish
nightly:
type: boolean
required: false
description: Whether to publish the package as a nightly release
default: true
workflow_call:
inputs:
release_tag:
type: string
required: true
description: The release tag to fetch the package to publish
nightly:
type: boolean
required: false
description: Whether to publish the package as a nightly release
default: true
release:
types:
- published
Expand All @@ -39,6 +49,12 @@ jobs:
contents: read
id-token: write
steps:
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # pin v4.1.7
with:
sparse-checkout: |
misc/*
timeout-minutes: 5

- name: Get tag version
id: version
run: |
Expand Down Expand Up @@ -86,6 +102,10 @@ jobs:
uses: samuelmeuli/action-snapcraft@d33c176a9b784876d966f80fb1b461808edc0641 # pin v2.1.1
timeout-minutes: 2

- name: Get releases for snapcraft
run: python misc/snapcraft_releases.py ${{ inputs.nightly && '--nightly' || '' }} | tee ${{ runner.temp }}/snap-releases-args
timeout-minutes: 1

- name: Check that snapcraft credential is not empty
run: test $(printenv SNAPCRAFT_STORE_CREDENTIALS | wc -c | tee /dev/stderr) -ne 0
env:
Expand All @@ -99,7 +119,7 @@ jobs:
timeout-minutes: 2

- name: Upload Snap
run: snapcraft upload --release=nightly/stable snap/Parsec_${{ steps.version.outputs.full }}_linux_*.snap
run: snapcraft upload $(cat ${{ runner.temp }}/snap-releases-args) snap/Parsec_${{ steps.version.outputs.full }}_linux_*.snap
env:
SNAPCRAFT_STORE_CREDENTIALS: ${{ secrets.SNAPCRAFT_CREDENTIALS }}
timeout-minutes: 5
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/releaser.yml
Original file line number Diff line number Diff line change
Expand Up @@ -227,3 +227,4 @@ jobs:
id-token: write
with:
release_tag: ${{ github.event_name == 'schedule' && 'nightly' || github.ref_name }}
nightly: ${{ github.event_name == 'schedule' || github.event_name == 'pull_request' || github.ref == 'refs/tags/nightly' }}

0 comments on commit 9e7b0b7

Please sign in to comment.