-
Notifications
You must be signed in to change notification settings - Fork 582
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
.github/workflows: changed versions to channels and other corrections
- Loading branch information
Showing
3 changed files
with
78 additions
and
69 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
name: Determine Go snap channels | ||
|
||
on: | ||
workflow_call: | ||
inputs: | ||
include-snapd-build-go-channel: | ||
description: 'Flag instructing to lookup the channel of Go snap used to build Snapd' | ||
required: false | ||
type: boolean | ||
include-latest-go-channel: | ||
description: 'Flag instructing to lookup the latest channel of Go snap' | ||
required: false | ||
type: boolean | ||
specific-go-channels: | ||
description: 'Space seperated list of required channels' | ||
required: false | ||
type: string | ||
outputs: | ||
go-channels: | ||
description: 'JSON list of Go snap channels to use to populate the gochannel matrix' | ||
value: ${{ jobs.determine.outputs.go-channels }} | ||
|
||
jobs: | ||
determine: | ||
runs-on: ubuntu-latest | ||
outputs: | ||
go-channels: ${{ steps.determine.outputs.go-channels }} | ||
steps: | ||
- name: Determine Go snap channels | ||
id: determine | ||
run: | | ||
# Initialize an empty list | ||
GO_CHANNELS=() | ||
# Optionally add specific channels | ||
if [ -n "${{ inputs.specific-go-channels }}" ]; then | ||
for CHANNEL in ${{ inputs.specific-go-channels }}; do | ||
GO_CHANNELS+=("$CHANNEL") | ||
done | ||
fi | ||
# Optionally add channel that snapd is build with | ||
if [ "${{ inputs.include-snapd-build-go-channel }}" = "true" ]; then | ||
# Simulate fetching the Snapd Go build channel (replace with actual logic) | ||
BUILD_CHANNEL="1.18" | ||
GO_CHANNELS+=("$BUILD_CHANNEL") | ||
fi | ||
# Optionally add latest channel | ||
if [ "${{ inputs.include-latest-go-channel }}" = "true" ]; then | ||
# Simulate fetching the latest Go channel (replace with actual logic) | ||
LATEST_CHANNEL="1.23" | ||
GO_CHANNELS+=("$LATEST_CHANNEL") | ||
fi | ||
# Remove duplicates and convert to JSON array | ||
UNIQUE_CHANNELS=$(printf '%s\n' "${GO_CHANNELS[@]}" | sort -u | jq -R . | jq -s .) | ||
# Output the list | ||
echo "::set-output name=go-channels::$UNIQUE_CHANNELS" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters