Skip to content

Commit e56500c

Browse files
committed
add release specific job actions
1 parent 318727b commit e56500c

File tree

1 file changed

+49
-0
lines changed

1 file changed

+49
-0
lines changed

.github/workflows/storybook.yml

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -341,3 +341,52 @@ jobs:
341341
export SITE_URL=$(echo ${row} | base64 --decode | jq -r ".url")
342342
gh api ${STATUS_URL} -f state=success -f environment_url=${SITE_URL} -H "Accept: application/vnd.github.ant-man-preview+json"
343343
done
344+
345+
attach-artifact:
346+
runs-on: ubuntu-latest
347+
if: ${{ contains(['released', 'prereleased'], github.event_name) }}
348+
needs:
349+
- framework-build
350+
steps:
351+
- uses: actions/checkout@v2
352+
353+
- uses: actions/download-artifact@v2
354+
with:
355+
path: workspace
356+
357+
- name: 'Github: attach artifact to release'
358+
env:
359+
DSE_API_RELEASE_TOKEN: ${{ secrets.DSE_API_RELEASE_TOKEN }}
360+
VERSION_FROM_TAG: ${{ github.event.release.tag_name }}
361+
run: |-
362+
gh release view ${VERSION_FROM_TAG} | grep ${VERSION_FROM_TAG}
363+
364+
if [ $? -eq 0 ]; then
365+
cp workspace/dist.zip workspace/slds-${VERSION_FROM_TAG}.zip
366+
echo "=============================="
367+
echo "» Attaching artifact to release ${VERSION_FROM_TAG}"
368+
gh release upload ${VERSION_FROM_TAG} workspace/slds-${VERSION_FROM_TAG}.zip#"SLDS ${VERSION_FROM_TAG}" --clobber
369+
else
370+
echo "=============================="
371+
echo "» ERROR: release ${VERSION_FROM_TAG} not found on Github"
372+
fi
373+
374+
update-database:
375+
runs-on: ubuntu-latest
376+
if: ${{ contains(['released', 'prereleased'], github.event_name) }}
377+
needs:
378+
- attach-artifact
379+
steps:
380+
- name: Trigger database update via API
381+
env:
382+
DSE_API_RELEASE_TOKEN: ${{ secrets.DSE_API_RELEASE_TOKEN }}
383+
VERSION_FROM_TAG: ${{ github.event.release.tag_name }}
384+
run: |-
385+
export SALESFORCE_VERSION=$(cat package.json | jq -r .slds.id)
386+
curl --location --request PATCH 'https://api.lightningdesignsystem.com/v1/release' \
387+
--header 'Content-Type: application/json' \
388+
--header 'Authorization: Bearer '"$DSE_API_RELEASE_TOKEN"'' \
389+
--data-raw '{
390+
"version":"'"${VERSION_FROM_TAG:1:20}"'",
391+
"salesforce_version": "'"$SALESFORCE_VERSION"'"
392+
}'

0 commit comments

Comments
 (0)