Skip to content

Commit

Permalink
add update hash handling to workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
denismaier committed Aug 6, 2024
1 parent abcb867 commit 9464e48
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions .github/workflows/create-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,30 @@ jobs:
scripts/build.sh ${BASE_NAME} $VERSION
echo "Built release ${BASE_NAME}-$VERSION"
- name: Handle update files
run: |
echo "Updating update manifests for $BASE_NAME-$VERSION"
updatelink="https://github.com/${REPO_OWNER}/${REPO_NAME}/releases/download/v${VERSION}/${BASE_NAME}-${VERSION}.xpi"
update_hash="sha256:$(shasum -a 256 "${BUILD_DIR}/${BASE_NAME}-${VERSION}.xpi" | cut -d' ' -f1)"
jq --arg version "$VERSION" \
--arg updatelink "$updatelink" \
--arg updatehash "$update_hash" \
--arg pluginID "$PLUGIN_ID" \
'.addons[$pluginID].updates[0].version = $version |
.addons[$pluginID].updates[0].update_link = $updatelink |
.addons[$pluginID].updates[0].update_hash = $updatehash' \
"$UPDATE_TEMPLATE_FILE" > "$UPDATE_JSON_FILE"
cp "$UPDATE_JSON_FILE" "$UPDATE_RDF_FILE"
# Commit changes if any
git add "$UPDATE_JSON_FILE" "$UPDATE_RDF_FILE"
if ! git diff-index --quiet HEAD -- "$UPDATE_JSON_FILE" "$UPDATE_RDF_FILE"; then
git commit -m "Update $UPDATE_JSON_FILE and $UPDATE_RDF_FILE"
fi
- name: Get release notes
run: |
echo "Extract release notes from ${CHANGELOG}"
Expand Down

0 comments on commit 9464e48

Please sign in to comment.