Open shurick81 opened 1 year ago
Do you know of a way to implement the trigger without having to stand up resources on Azure?
I'm not sure :). Do you know what signal we could use for the trigger? Is there any feed in the internet we could use for even receiving a firm signal that the new SPFx is released? Publicly available release pipelines maybe?
SPFx is built internally. The only reliable public signal is the npm feed, which would require polling, which I don't think is a reliable way to go about it. Plus, how would we handle changes to Node version which require us to modify the Dockerfile before building the image? While I'm all for automation, I wonder if in this case it's not overcomplicating it.
I have prepared some POC that notifies me when the pipeline fails:
https://github.com/shurick81/docker-spfx/blob/master/.github/workflows/new-spfx-issue.yaml
https://github.com/shurick81/docker-spfx/actions
it would be great if we could also create an issue in Github automatically, not just notify about the failure.
This is the only code I added:
name: New SPFx Task
on:
schedule:
# * is a special character in YAML so you have to quote this string
- cron: '30 5,17 * * *'
jobs:
version-compare:
runs-on: ubuntu-20.04
container: node:16.20.0
steps:
- name: Comparing Current Version
run: |
apt-get update
apt-get install jq -y
package_info="$(npm view @microsoft/generator-sharepoint --json)"
latest_version="$(echo "$package_info" | jq '.version' --raw-output)"
if [ "$latest_version" != "1.17.2" ]; then
echo "@microsoft/generator-sharepoint latest version is $latest_version";
exit 1;
fi;
Rather than using a fixed version number in the action and having to update it each time a new version of SPFx has been released, what if we grabbed the latest version of the Docker image that we published and compared against it? Basically, if the latest version on npm and Docker are different, there's work to be done.
Yes, good idea for improvement :)
Would it be possible to automate the process to that every time when the new SPFx version is out, we have a new issue created in this project, for updating the docker image?