Skip to content

Commit f7af992

Browse files
committed
Fix version detection
1 parent c8d4812 commit f7af992

File tree

3 files changed

+17
-29
lines changed

3 files changed

+17
-29
lines changed

.github/workflows/external_trigger.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,8 @@ jobs:
2929
echo "> [!NOTE]" >> $GITHUB_STEP_SUMMARY
3030
echo "> External trigger running off of gpu branch. To disable this trigger, add \`piper_gpu\` into the Github organizational variable \`SKIP_EXTERNAL_TRIGGER\`." >> $GITHUB_STEP_SUMMARY
3131
printf "\n## Retrieving external version\n\n" >> $GITHUB_STEP_SUMMARY
32-
EXT_RELEASE=$(curl -u "${{ secrets.CR_USER }}:${{ secrets.CR_PAT }}" -sX GET "https://api.github.com/repos/rhasspy/wyoming-piper/commits/master" | jq -r '. | .sha' | cut -c1-8)
33-
echo "Type is \`github_commit\`" >> $GITHUB_STEP_SUMMARY
32+
EXT_RELEASE=$(curl -sL "https://pypi.python.org/pypi/wyoming-piper/json" |jq -r '. | .info.version')
33+
echo "Type is \`pip_version\`" >> $GITHUB_STEP_SUMMARY
3434
if grep -q "^piper_gpu_${EXT_RELEASE}" <<< "${SKIP_EXTERNAL_TRIGGER}"; then
3535
echo "> [!WARNING]" >> $GITHUB_STEP_SUMMARY
3636
echo "> Github organizational variable \`SKIP_EXTERNAL_TRIGGER\` matches current external release; skipping trigger." >> $GITHUB_STEP_SUMMARY

Jenkinsfile

Lines changed: 13 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,7 @@ pipeline {
1919
DOCKERHUB_TOKEN=credentials('docker-hub-ci-pat')
2020
QUAYIO_API_TOKEN=credentials('quayio-repo-api-token')
2121
GIT_SIGNING_KEY=credentials('484fbca6-9a4f-455e-b9e3-97ac98785f5f')
22-
EXT_GIT_BRANCH = 'master'
23-
EXT_USER = 'rhasspy'
24-
EXT_REPO = 'wyoming-piper'
22+
EXT_PIP = 'wyoming-piper'
2523
BUILD_VERSION_ARG = 'PIPER_VERSION'
2624
LS_USER = 'linuxserver'
2725
LS_REPO = 'docker-piper'
@@ -143,25 +141,17 @@ pipeline {
143141
/* ########################
144142
External Release Tagging
145143
######################## */
146-
// If this is a github commit trigger determine the current commit at head
147-
stage("Set ENV github_commit"){
148-
steps{
149-
script{
150-
env.EXT_RELEASE = sh(
151-
script: '''curl -H "Authorization: token ${GITHUB_TOKEN}" -s https://api.github.com/repos/${EXT_USER}/${EXT_REPO}/commits/${EXT_GIT_BRANCH} | jq -r '. | .sha' | cut -c1-8 ''',
152-
returnStdout: true).trim()
153-
}
154-
}
155-
}
156-
// If this is a github commit trigger Set the external release link
157-
stage("Set ENV commit_link"){
158-
steps{
159-
script{
160-
env.RELEASE_LINK = 'https://github.com/' + env.EXT_USER + '/' + env.EXT_REPO + '/commit/' + env.EXT_RELEASE
161-
}
162-
}
163-
}
164-
// Sanitize the release tag and strip illegal docker or github characters
144+
// If this is a pip release set the external tag to the pip version
145+
stage("Set ENV pip_version"){
146+
steps{
147+
script{
148+
env.EXT_RELEASE = sh(
149+
script: '''curl -sL https://pypi.python.org/pypi/${EXT_PIP}/json |jq -r '. | .info.version' ''',
150+
returnStdout: true).trim()
151+
env.RELEASE_LINK = 'https://pypi.python.org/pypi/' + env.EXT_PIP
152+
}
153+
}
154+
} // Sanitize the release tag and strip illegal docker or github characters
165155
stage("Sanitize tag"){
166156
steps{
167157
script{
@@ -1026,7 +1016,7 @@ pipeline {
10261016
"type": "commit",\
10271017
"tagger": {"name": "LinuxServer-CI","email": "[email protected]","date": "'${GITHUB_DATE}'"}}'
10281018
echo "Pushing New release for Tag"
1029-
curl -H "Authorization: token ${GITHUB_TOKEN}" -s https://api.github.com/repos/${EXT_USER}/${EXT_REPO}/commits/${EXT_RELEASE_CLEAN} | jq -r '.commit.message' > releasebody.json
1019+
echo "Updating PIP version of ${EXT_PIP} to ${EXT_RELEASE_CLEAN}" > releasebody.json
10301020
jq -n \
10311021
--arg tag_name "$META_TAG" \
10321022
--arg target_commitish "gpu" \

jenkins-vars.yml

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,12 @@
22

33
# jenkins variables
44
project_name: docker-piper
5-
external_type: github_commit
5+
external_type: pip_version
66
release_type: prerelease
77
release_tag: gpu
88
ls_branch: gpu
99
repo_vars:
10-
- EXT_GIT_BRANCH = 'master'
11-
- EXT_USER = 'rhasspy'
12-
- EXT_REPO = 'wyoming-piper'
10+
- EXT_PIP = 'wyoming-piper'
1311
- BUILD_VERSION_ARG = 'PIPER_VERSION'
1412
- LS_USER = 'linuxserver'
1513
- LS_REPO = 'docker-piper'

0 commit comments

Comments
 (0)