Skip to content
/ pywemo Public
forked from pywemo/pywemo

Commit

Permalink
Inline the update js
Browse files Browse the repository at this point in the history
  • Loading branch information
esev committed May 9, 2023
1 parent 1b5dcab commit 0e4ff74
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 36 deletions.
31 changes: 0 additions & 31 deletions .github/update_release_notes.js

This file was deleted.

23 changes: 19 additions & 4 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -108,16 +108,31 @@ jobs:
./hashes/* \
./${{ needs.slsa.outputs.provenance-name }}/*.intoto.jsonl \
./signing-artifacts-sigstore/*/*.sigstore
- name: Add SHA256SUM environment variable
run: |
EOF=$(dd if=/dev/urandom bs=15 count=1 status=none | base64)
echo "SHA256SUM<<$EOF" >> "$GITHUB_ENV"
cat ./hashes/*.sha256sum.txt >> "$GITHUB_ENV"
echo "$EOF" >> "$GITHUB_ENV"
- name: Update release text
env:
BODY: ${{ github.event.release.body || '' }}
RELEASE_ID: ${{ github.event.release.id }}
TEMPLATE_FILE: ./.github/RELEASE_NOTES_TEMPLATE.md
SHA256SUM_TXT: ./hashes/pywemo-${{ needs.build.outputs.version }}.sha256sum.txt
uses: actions/github-script@v6
with:
script: |
const update = require('./.github/update_release_notes.js')
const result = await update({github, context, process});
console.log(result);
const fsp = require('fs').promises;
let template = await fsp.readFile(process.env.TEMPLATE_FILE, { encoding: 'utf8' });
for (const [key, value] of Object.entries(process.env)) {
template = template.replaceAll(`\${${key}}`, value);
}
await github.rest.repos.updateRelease({
...context.repo,
release_id: process.env.RELEASE_ID,
body: template.replace('${BODY}', body),
});
pypi:
name: Publish to PyPi
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ build-backend = "poetry.core.masonry.api"

[tool.poetry]
name = "pywemo-esev"
version = "0.9.1rc17"
version = "0.9.1rc18"
description = "Lightweight Python module to discover and control WeMo devices"
authors = ["Eric Severance <[email protected]>"]
license = "MIT"
Expand Down

0 comments on commit 0e4ff74

Please sign in to comment.