-
Notifications
You must be signed in to change notification settings - Fork 13
Dev #281
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Dev #281
Changes from all commits
a0ce11e
ef7088c
4ef52e9
90bfb23
52545a7
7c7d206
ffeb01a
efe0886
ec8078e
137982a
07fed07
ac34b97
cbcf218
eecb383
9e8bf15
f50ff5c
f888814
cac1b76
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -0,0 +1,182 @@ | ||||||||||||||||||||||||||||||||||
| name: Create Draft Release | ||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||
| on: | ||||||||||||||||||||||||||||||||||
| pull_request: | ||||||||||||||||||||||||||||||||||
| types: [closed] | ||||||||||||||||||||||||||||||||||
| branches: | ||||||||||||||||||||||||||||||||||
| - master | ||||||||||||||||||||||||||||||||||
| workflow_dispatch: | ||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||
| jobs: | ||||||||||||||||||||||||||||||||||
| create-draft-release: | ||||||||||||||||||||||||||||||||||
| runs-on: [self-hosted, Linux] | ||||||||||||||||||||||||||||||||||
| if: github.event_name == 'workflow_dispatch' || (github.event.pull_request.merged == true && github.event.pull_request.head.ref == 'dev') | ||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||
| steps: | ||||||||||||||||||||||||||||||||||
| - name: Checkout code | ||||||||||||||||||||||||||||||||||
| uses: actions/checkout@v4 | ||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||
| - name: Download Mac artifacts | ||||||||||||||||||||||||||||||||||
| uses: actions/github-script@v6 | ||||||||||||||||||||||||||||||||||
| id: download-mac-artifacts | ||||||||||||||||||||||||||||||||||
|
Comment on lines
+20
to
+21
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Update deprecated actions to Node20-compatible versions actionlint flagged actions using deprecated Node runtimes. Upgrade to resolve runtime failures on GitHub-hosted and many self-hosted runners. - uses: actions/github-script@v6
+ uses: actions/github-script@v7
...
- uses: actions/github-script@v6
+ uses: actions/github-script@v7
...
- uses: softprops/action-gh-release@v1
+ uses: softprops/action-gh-release@v2Also applies to: 65-66, 171-172 🧰 Tools🪛 actionlint (1.7.7)20-20: the runner of "actions/github-script@v6" action is too old to run on GitHub Actions. update the action's version to fix this issue (action) 🤖 Prompt for AI Agents |
||||||||||||||||||||||||||||||||||
| with: | ||||||||||||||||||||||||||||||||||
| script: | | ||||||||||||||||||||||||||||||||||
| const { owner, repo } = context.repo; | ||||||||||||||||||||||||||||||||||
| const workflows = await github.rest.actions.listRepoWorkflows({ owner, repo }); | ||||||||||||||||||||||||||||||||||
| const macWorkflow = workflows.data.workflows.find(w => w.name === 'upload build artifact mac'); | ||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||
| if (macWorkflow) { | ||||||||||||||||||||||||||||||||||
| const runs = await github.rest.actions.listWorkflowRuns({ | ||||||||||||||||||||||||||||||||||
| owner, | ||||||||||||||||||||||||||||||||||
| repo, | ||||||||||||||||||||||||||||||||||
| workflow_id: macWorkflow.id, | ||||||||||||||||||||||||||||||||||
| branch: 'dev', | ||||||||||||||||||||||||||||||||||
| per_page: 1, | ||||||||||||||||||||||||||||||||||
| status: 'success' | ||||||||||||||||||||||||||||||||||
| }); | ||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||
| if (runs.data.workflow_runs.length > 0) { | ||||||||||||||||||||||||||||||||||
| const runId = runs.data.workflow_runs[0].id; | ||||||||||||||||||||||||||||||||||
| const artifacts = await github.rest.actions.listWorkflowRunArtifacts({ | ||||||||||||||||||||||||||||||||||
| owner, | ||||||||||||||||||||||||||||||||||
| repo, | ||||||||||||||||||||||||||||||||||
| run_id: runId | ||||||||||||||||||||||||||||||||||
| }); | ||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||
| for (const artifact of artifacts.data.artifacts) { | ||||||||||||||||||||||||||||||||||
| if (artifact.name === 'EmotiBitSoftware-macos') { | ||||||||||||||||||||||||||||||||||
| const download = await github.rest.actions.downloadArtifact({ | ||||||||||||||||||||||||||||||||||
| owner, | ||||||||||||||||||||||||||||||||||
| repo, | ||||||||||||||||||||||||||||||||||
| artifact_id: artifact.id, | ||||||||||||||||||||||||||||||||||
| archive_format: 'zip' | ||||||||||||||||||||||||||||||||||
| }); | ||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||
| const fs = require('fs'); | ||||||||||||||||||||||||||||||||||
| fs.writeFileSync('EmotiBitSoftware-macos.zip', Buffer.from(download.data)); | ||||||||||||||||||||||||||||||||||
| core.setOutput('mac-artifact-downloaded', 'true'); | ||||||||||||||||||||||||||||||||||
| break; | ||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||
| - name: Download Windows artifacts | ||||||||||||||||||||||||||||||||||
| uses: actions/github-script@v6 | ||||||||||||||||||||||||||||||||||
| id: download-win-artifacts | ||||||||||||||||||||||||||||||||||
| with: | ||||||||||||||||||||||||||||||||||
| script: | | ||||||||||||||||||||||||||||||||||
| const { owner, repo } = context.repo; | ||||||||||||||||||||||||||||||||||
| const workflows = await github.rest.actions.listRepoWorkflows({ owner, repo }); | ||||||||||||||||||||||||||||||||||
| const winWorkflow = workflows.data.workflows.find(w => w.name === 'upload build artifact Windows'); | ||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||
| if (winWorkflow) { | ||||||||||||||||||||||||||||||||||
| const runs = await github.rest.actions.listWorkflowRuns({ | ||||||||||||||||||||||||||||||||||
| owner, | ||||||||||||||||||||||||||||||||||
| repo, | ||||||||||||||||||||||||||||||||||
| workflow_id: winWorkflow.id, | ||||||||||||||||||||||||||||||||||
| branch: 'dev', | ||||||||||||||||||||||||||||||||||
| per_page: 1, | ||||||||||||||||||||||||||||||||||
| status: 'success' | ||||||||||||||||||||||||||||||||||
| }); | ||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||
| if (runs.data.workflow_runs.length > 0) { | ||||||||||||||||||||||||||||||||||
| const runId = runs.data.workflow_runs[0].id; | ||||||||||||||||||||||||||||||||||
| const artifacts = await github.rest.actions.listWorkflowRunArtifacts({ | ||||||||||||||||||||||||||||||||||
| owner, | ||||||||||||||||||||||||||||||||||
| repo, | ||||||||||||||||||||||||||||||||||
| run_id: runId | ||||||||||||||||||||||||||||||||||
| }); | ||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||
| for (const artifact of artifacts.data.artifacts) { | ||||||||||||||||||||||||||||||||||
| if (artifact.name === 'EmotiBitSoftware-Windows') { | ||||||||||||||||||||||||||||||||||
| const download = await github.rest.actions.downloadArtifact({ | ||||||||||||||||||||||||||||||||||
| owner, | ||||||||||||||||||||||||||||||||||
| repo, | ||||||||||||||||||||||||||||||||||
| artifact_id: artifact.id, | ||||||||||||||||||||||||||||||||||
| archive_format: 'zip' | ||||||||||||||||||||||||||||||||||
| }); | ||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||
| const fs = require('fs'); | ||||||||||||||||||||||||||||||||||
| fs.writeFileSync('EmotiBitSoftware-Windows.zip', Buffer.from(download.data)); | ||||||||||||||||||||||||||||||||||
| core.setOutput('win-artifact-downloaded', 'true'); | ||||||||||||||||||||||||||||||||||
| break; | ||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||
| - name: Generate release notes | ||||||||||||||||||||||||||||||||||
| id: generate-release-notes | ||||||||||||||||||||||||||||||||||
| run: | | ||||||||||||||||||||||||||||||||||
| RELEASE_NOTES=$(cat <<-END_OF_NOTES | ||||||||||||||||||||||||||||||||||
| # New features and bug fixes | ||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||
| # Firmware Installed by FirmwareInstaller | ||||||||||||||||||||||||||||||||||
| EmotiBit firmware [`vx.x.x`](enter-url-here) | ||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||
| # PRs completed | ||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||
| # Installation | ||||||||||||||||||||||||||||||||||
| #### Windows | ||||||||||||||||||||||||||||||||||
| - Download the `EmotiBitSoftware-Windows.zip` linked below. | ||||||||||||||||||||||||||||||||||
| - Extract the zip file downloaded | ||||||||||||||||||||||||||||||||||
| - run the `.msi` installer file. | ||||||||||||||||||||||||||||||||||
| - If the **Windows Defender Smartscreen** pops up, click on `More info` and `Run anyway` | ||||||||||||||||||||||||||||||||||
| - The `EmotiBit Oscilloscope` and `EmotiBit DataParser` will be installed on your system. | ||||||||||||||||||||||||||||||||||
| - You can access the software from the `Start` menu under `EmotiBit` or from the desktop shortcut. | ||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||
| #### macOS | ||||||||||||||||||||||||||||||||||
| - Download `EmotiBitSoftware-macOS` | ||||||||||||||||||||||||||||||||||
| - Extract the downloaded zip file. | ||||||||||||||||||||||||||||||||||
| - The extracted folder will contain `EmotiBit Oscilloscope` and `EmotiBit DataParser`. | ||||||||||||||||||||||||||||||||||
| - Right-click and select `Open` to run the executables | ||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||
| #### Linux | ||||||||||||||||||||||||||||||||||
| - Download the source code linked below. Follow the steps in the [ReadMe](https://github.com/EmotiBit/ofxEmotiBit#readme). | ||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||
| END_OF_NOTES | ||||||||||||||||||||||||||||||||||
| ) | ||||||||||||||||||||||||||||||||||
| echo "release_notes<<EOF" >> $GITHUB_OUTPUT | ||||||||||||||||||||||||||||||||||
| echo "$RELEASE_NOTES" >> $GITHUB_OUTPUT | ||||||||||||||||||||||||||||||||||
| echo "EOF" >> $GITHUB_OUTPUT | ||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||
| - name: Get version from source | ||||||||||||||||||||||||||||||||||
| id: get_version | ||||||||||||||||||||||||||||||||||
| run: | | ||||||||||||||||||||||||||||||||||
| VERSION=$(grep src/ofxEmotiBitVersion.h -e "ofxEmotiBitVersion" | grep -o '"[^"]*"' | tr -d '"') | ||||||||||||||||||||||||||||||||||
| echo "version=$VERSION" >> $GITHUB_OUTPUT | ||||||||||||||||||||||||||||||||||
| echo "tag=v$VERSION" >> $GITHUB_OUTPUT | ||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||
| - name: Create config.txt | ||||||||||||||||||||||||||||||||||
| id: create-config | ||||||||||||||||||||||||||||||||||
| run: | | ||||||||||||||||||||||||||||||||||
| CONFIG_CONTENT=$(cat <<-END_OF_CONFIG | ||||||||||||||||||||||||||||||||||
| { | ||||||||||||||||||||||||||||||||||
| "WifiCredentials": [ | ||||||||||||||||||||||||||||||||||
| { | ||||||||||||||||||||||||||||||||||
| "ssid": "YOUR_WIFI_NAME_GOES_HERE", | ||||||||||||||||||||||||||||||||||
| "password": "YOUR_WIFI_PASSWORD_GOES_HERE" | ||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||
| ] | ||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||
| END_OF_CONFIG | ||||||||||||||||||||||||||||||||||
| ) | ||||||||||||||||||||||||||||||||||
| echo "$CONFIG_CONTENT" > config.txt | ||||||||||||||||||||||||||||||||||
| echo "Config file created successfully" | ||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||
| - name: Create Draft Release | ||||||||||||||||||||||||||||||||||
| id: create-release | ||||||||||||||||||||||||||||||||||
| uses: softprops/action-gh-release@v1 | ||||||||||||||||||||||||||||||||||
| with: | ||||||||||||||||||||||||||||||||||
| draft: true | ||||||||||||||||||||||||||||||||||
| tag_name: ${{ steps.get_version.outputs.tag }} | ||||||||||||||||||||||||||||||||||
| name: Draft Release ${{ steps.get_version.outputs.tag }} | ||||||||||||||||||||||||||||||||||
| body: ${{ steps.generate-release-notes.outputs.release_notes }} | ||||||||||||||||||||||||||||||||||
| files: | | ||||||||||||||||||||||||||||||||||
| EmotiBitSoftware-macos.zip | ||||||||||||||||||||||||||||||||||
| EmotiBitSoftware-Windows.zip | ||||||||||||||||||||||||||||||||||
| config.txt | ||||||||||||||||||||||||||||||||||
| env: | ||||||||||||||||||||||||||||||||||
|
Comment on lines
+176
to
+181
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🛠️ Refactor suggestion Gracefully handle missing artifacts to avoid release step failures If either artifact isn’t found, softprops/action-gh-release will fail when files are missing. Either conditionally include files, or instruct the action to ignore unmatched files. with:
draft: true
tag_name: ${{ steps.get_version.outputs.tag }}
name: Draft Release ${{ steps.get_version.outputs.tag }}
body: ${{ steps.generate-release-notes.outputs.release_notes }}
+ fail_on_unmatched_files: false
files: |
EmotiBitSoftware-macos.zip
EmotiBitSoftware-Windows.zip
config.txt📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents |
||||||||||||||||||||||||||||||||||
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||||||||||||||||||||||||||||||||||
| Original file line number | Diff line number | Diff line change | ||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -51,5 +51,5 @@ | |||||||||||
| *Results.txt | ||||||||||||
| */bin | ||||||||||||
| EmotiBitIcons/otherFormats | ||||||||||||
| */*xcodeproj/*data/* | ||||||||||||
| */*xcodeproj/*workspace/* | ||||||||||||
| */*xcodeproj/*workspace/* | ||||||||||||
| **/xcuser*/** | ||||||||||||
|
Comment on lines
+54
to
+55
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 💡 Verification agent 🧩 Analysis chainOver-broad Xcode ignore may drop shared schemes from future changes Ignoring the entire project.xcworkspace subtree (Line 54) will also ignore xcshareddata, preventing shared schemes from being added/updated in the repo. You already track shared schemes in this PR; this rule will make future scheme updates silently untracked for untracked files. Refine the patterns to ignore only per-user data: Apply this diff: -*/*xcodeproj/*workspace/*
-**/xcuser*/**
+**/*.xcodeproj/project.xcworkspace/xcuserdata/**
+**/*.xcodeproj/xcuserdata/**
+**/*.xcuserstateFollow-up:
🏁 Script executed: #!/bin/bash
set -e
echo "Lines 54-60 of .gitignore:"
sed -n '54,60p' .gitignore || echo "Unable to read .gitignore"
echo
echo "Occurrences of 'xcshareddata' in .gitignore:"
grep -n "xcshareddata" .gitignore || echo "None"
echo
echo "Tracked files with 'xcshareddata' in path:"
git ls-files | grep "xcshareddata" || echo "None"Length of output: 1114 🏁 Script executed: #!/bin/bash
set -e
echo "List of .xcworkspace directories:"
find . -type d -name "*.xcworkspace" || echo "None"
echo
echo "Contents of each .xcworkspace directory (depth 2):"
for d in $(find . -type d -name "*.xcworkspace"); do
echo "Directory: $d"
find "$d" -maxdepth 2 | sed 's/^/ /'
done
echo
echo "xcshareddata directories under .xcworkspace:"
find . -type d -name "xcshareddata" | grep "\.xcworkspace" || echo "None"Length of output: 466 🏁 Script executed: #!/bin/bash
set -e
echo "Checking .gitignore rules affecting xcshareddata files:"
files=$(git ls-files | grep '/xcshareddata/')
if [ -z "$files"; then
echo "No xcshareddata files found"
exit 0
fi
echo "Files to check:"
echo "$files"
echo
echo "Ignored entries (if any):"
git check-ignore -v $files || echo "None of the xcshareddata files are ignored"Length of output: 3851 🏁 Script executed: #!/bin/bash
set -e
echo "Inspecting contents of EmotiBitDataParser.xcodeproj at depth 2:"
find EmotiBitDataParser/EmotiBitDataParser.xcodeproj -maxdepth 2 | sed 's/^/ /'Length of output: 480 Refine .gitignore to ignore only per-user Xcode data and preserve shared schemes We’ve verified that none of the files under - */*xcodeproj/*workspace/*
- **/xcuser*/**
+ **/*.xcworkspace/xcuserdata/**
+ **/*.xcodeproj/xcuserdata/**
+ **/*.xcuserstateFollow-up:
📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents |
||||||||||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Job guard is fine, but missing explicit permissions can break artifact listing and release creation
Listing workflows and artifacts needs actions: read; creating releases needs contents: write. Without explicit permissions, GITHUB_TOKEN may be insufficient on pull_request/closed and workflow_dispatch.
on: pull_request: types: [closed] branches: - master workflow_dispatch: +permissions: + contents: write # required for release creation + actions: read # required to list workflows/runs/artifacts + id-token: none + issues: read + pull-requests: read📝 Committable suggestion
🤖 Prompt for AI Agents