Add steps to publish to Snapcraft (#1102)

Draft until our Snap package is approved for classic confinement:
https://forum.snapcraft.io/t/classic-confinement-request-for-waveterm/43562
This commit is contained in:
Evan Simkowitz 2024-10-23 22:24:33 -07:00 committed by GitHub
parent fe7d849bfe
commit 3bd9249e81
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 22 additions and 0 deletions

View File

@ -16,6 +16,8 @@ jobs:
with:
version: 3.x
repo-token: ${{ secrets.GITHUB_TOKEN }}
- name: Install Snapcraft
uses: samuelmeuli/action-snapcraft@v2
- name: Publish from staging
run: "task artifacts:publish:${{ github.ref_name }}"
env:
@ -23,6 +25,17 @@ jobs:
AWS_SECRET_ACCESS_KEY: "${{ secrets.PUBLISHER_KEY_SECRET }}"
AWS_DEFAULT_REGION: us-west-2
shell: bash
- name: Download Snap from Release
uses: i3h/download-release-asset@v1
with:
owner: wavetermdev
repo: waveterm
tag: ${{github.ref_name}}
file: /*.snap/
- name: Publish to Snapcraft
run: "task artifacts:publish:snap:${{ github.ref_name }}"
env:
SNAPCRAFT_STORE_CREDENTIALS: "${{secrets.SNAPCRAFT_LOGIN_CREDS}}"
bump-winget:
if: ${{ startsWith(github.ref, 'refs/tags/') && !contains(github.ref_name, 'beta') }}
runs-on: windows-latest

View File

@ -230,6 +230,14 @@ tasks:
echo "https://$SUFFIX"
fi
done
artifacts:publish:snap:*:
desc: Publishes the specified artifacts version to Snapcraft.
vars:
UP_VERSION: '{{ replace "v" "" (index .MATCH 0)}}'
CHANNEL: '{{if contains .UP_VERSION "beta"}}beta{{else}}beta,stable{{end}}'
cmd: |
snapcraft upload --release={{.CHANNEL}} waveterm_{{.UP_VERSION}}_arm64.snap
snapcraft upload --release={{.CHANNEL}} waveterm_{{.UP_VERSION}}_amd64.snap
artifacts:publish:winget:*:
desc: Submits a version bump request to WinGet for the latest release.

View File

@ -88,6 +88,7 @@ const config = {
base: "core22",
confinement: "classic",
allowNativeWayland: true,
artifactName: `${productName}_${version}_${arch}.${ext}`,
},
publish: {
provider: "generic",