Bug Fix #1403 - Set grade and channel correctly (#1450)

Signed-off-by: David Sims <simsdj82@gmail.com>
This commit is contained in:
David Sims 2024-04-10 00:41:35 +10:00 committed by GitHub
parent e1e182987b
commit 5536f790fd
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 15 additions and 4 deletions

View File

@ -6,8 +6,12 @@ on:
tag:
description: "Git tag (leave empty for dry run)"
required: false
latest:
description: "Release as latest?"
required: true
type: boolean
prerelease:
description: "Is this a pre-release?"
description: "Release as prerelease?"
required: true
type: boolean
@ -129,7 +133,8 @@ jobs:
# goreleaser won't sign the packages.
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SNAPCRAFT_STORE_CREDENTIALS: ${{ secrets.SNAPCRAFT_STORE_TOKEN }}
SNAPCRAFT_CHANNEL: ${{ inputs.prerelease && 'edge' || 'stable' }}
RELEASE_FLAG_PRERELEASE: ${{ inputs.prerelease }}
RELEASE_FLAG_LATEST: ${{ inputs.latest }}
- name: Remove GPG key
if: always()

3
.gitignore vendored
View File

@ -34,3 +34,6 @@ dist/
# Licensei cache file
.licensei.cache
# Development temp folder
tmp

View File

@ -206,10 +206,13 @@ snapcrafts:
OpenTofu is an OSS tool for building, changing, and versioning infrastructure
safely and efficiently. OpenTofu can manage existing and popular service
providers as well as custom in-house solutions.
base: core22
grade: "{{ .Env.SNAPCRAFT_CHANNEL }}"
disable: '{{ if eq .Env.RELEASE_FLAG_LATEST "false" }}true{{ else }}false{{ end }}'
channel_templates:
- '{{ if eq .Env.RELEASE_FLAG_PRERELEASE "true" }}latest/edge{{ else }}latest/stable{{ end }}'
grade: '{{ if eq .Env.RELEASE_FLAG_PRERELEASE "true" }}devel{{ else }}stable{{ end }}'
confinement: classic
license: MPL-2.0
base: core22
apps:
tofu:
command: tofu