40 lines
1.1 KiB
YAML
40 lines
1.1 KiB
YAML
kind: pipeline
|
|
name: release
|
|
|
|
trigger:
|
|
release: true
|
|
|
|
steps:
|
|
# - name: checkout
|
|
# image: plugins/git
|
|
# settings:
|
|
# repo: https://github.com/insignia-live/setup-assistant-release.git
|
|
|
|
- name: run
|
|
image: alpine:3.13
|
|
commands:
|
|
- apk add --no-cache curl jq
|
|
- |
|
|
latestReleaseTag=$(curl -s "https://api.github.com/repos/insignia-live/setup-assistant-release/releases/latest" | jq -r '.tag_name')
|
|
targetReleaseTag="2023-02-13-1223" # Replace with your target release tag
|
|
|
|
if [[ "$latestReleaseTag" > "$targetReleaseTag" ]]; then
|
|
echo "This pipeline is run because the new release is newer than the one I have."
|
|
elif [[ "$latestReleaseTag" = "$targetReleaseTag" ]]; then
|
|
echo "The release tag is the same as the target tag."
|
|
echo "Running testing step..."
|
|
else
|
|
echo "The new release is older than the one I have."
|
|
exit 0 # Trigger the testing step
|
|
fi
|
|
when:
|
|
status:
|
|
- success
|
|
- failure
|
|
- changed
|
|
|
|
- name: testing
|
|
image: alpine
|
|
commands:
|
|
- echo "test"
|