-
Notifications
You must be signed in to change notification settings - Fork 133
ci: Add a workflow for uploading files #1157
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
Merged
Merged
Changes from 2 commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
9b6e12e
ci: Add a workflow for uploading files
kolipakakondal 0f8dcc1
fix: git diff
kolipakakondal ba2e9c6
fix: identify changes based on the path
kolipakakondal cf9442b
fix:update path
kolipakakondal aed6bbb
fix:update path
kolipakakondal File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,54 @@ | ||
| name: IDE File Uploads | ||
|
|
||
| on: | ||
| push: | ||
| branches: | ||
| - master | ||
| pull_request: | ||
| branches: | ||
| - master | ||
|
|
||
| jobs: | ||
| upload-file: | ||
| runs-on: ubuntu-latest | ||
|
|
||
| steps: | ||
| - name: Checkout repository | ||
| uses: actions/checkout@v4 | ||
|
|
||
| - name: Check for changes in uploads folder | ||
| id: check_changes | ||
| uses: actions/github-script@v6 | ||
| with: | ||
| script: | | ||
| const changedFiles = await github.paginate( | ||
| github.rest.repos.compareCommits, | ||
| { | ||
| owner: context.repo.owner, | ||
| repo: context.repo.repo, | ||
| base: context.payload.before, | ||
| head: context.sha, | ||
| } | ||
| ); | ||
|
|
||
| const hasChanges = changedFiles.some(file => file.filename.startsWith('internal/com.espressif.idf.uploads/')); | ||
| core.setOutput('changed', hasChanges); | ||
|
|
||
| - name: Upload file to S3 | ||
| if: steps.check_changes.outputs.changed == 'true' | ||
| env: | ||
| AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} | ||
| AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} | ||
| AWS_DEFAULT_REGION: ${{ secrets.AWS_DEFAULT_REGION }} | ||
| run: | | ||
| FILE="./internal/com.espressif.idf.uploads/cmakeed/CMakeEd-1.24.1.zip" | ||
| FILE_NAME=$(basename "$FILE") | ||
| BUCKET_NAME="dl.espressif.com" | ||
| REMOTE_PATH="dl/cmakeed/updates/" | ||
|
|
||
| if [ -f "$FILE" ]; then | ||
| echo "Uploading $FILE_NAME to S3..." | ||
| aws s3 cp "$FILE" "s3://$BUCKET_NAME/$REMOTE_PATH$FILE_NAME" --acl public-read | ||
| else | ||
| echo "File $FILE not found, skipping..." | ||
| fi | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,10 @@ | ||
| <?xml version="1.0" encoding="UTF-8"?> | ||
| <classpath> | ||
| <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-17"> | ||
| <attributes> | ||
| <attribute name="module" value="true"/> | ||
| </attributes> | ||
| </classpathentry> | ||
| <classpathentry kind="src" path="src"/> | ||
| <classpathentry kind="output" path="bin"/> | ||
| </classpath> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,17 @@ | ||
| <?xml version="1.0" encoding="UTF-8"?> | ||
| <projectDescription> | ||
| <name>com.espressif.idf.uploads</name> | ||
| <comment></comment> | ||
| <projects> | ||
| </projects> | ||
| <buildSpec> | ||
| <buildCommand> | ||
| <name>org.eclipse.jdt.core.javabuilder</name> | ||
| <arguments> | ||
| </arguments> | ||
| </buildCommand> | ||
| </buildSpec> | ||
| <natures> | ||
| <nature>org.eclipse.jdt.core.javanature</nature> | ||
| </natures> | ||
| </projectDescription> |
2 changes: 2 additions & 0 deletions
2
internal/com.espressif.idf.uploads/.settings/org.eclipse.core.resources.prefs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,2 @@ | ||
| eclipse.preferences.version=1 | ||
| encoding/<project>=UTF-8 |
14 changes: 14 additions & 0 deletions
14
internal/com.espressif.idf.uploads/.settings/org.eclipse.jdt.core.prefs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,14 @@ | ||
| eclipse.preferences.version=1 | ||
| org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled | ||
| org.eclipse.jdt.core.compiler.codegen.targetPlatform=17 | ||
| org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve | ||
| org.eclipse.jdt.core.compiler.compliance=17 | ||
| org.eclipse.jdt.core.compiler.debug.lineNumber=generate | ||
| org.eclipse.jdt.core.compiler.debug.localVariable=generate | ||
| org.eclipse.jdt.core.compiler.debug.sourceFile=generate | ||
| org.eclipse.jdt.core.compiler.problem.assertIdentifier=error | ||
| org.eclipse.jdt.core.compiler.problem.enablePreviewFeatures=disabled | ||
| org.eclipse.jdt.core.compiler.problem.enumIdentifier=error | ||
| org.eclipse.jdt.core.compiler.problem.reportPreviewFeatures=warning | ||
| org.eclipse.jdt.core.compiler.release=enabled | ||
| org.eclipse.jdt.core.compiler.source=17 |
Binary file not shown.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| Updated on 19th Feb 2025 1:47PM |
Binary file not shown.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,9 @@ | ||
| /** | ||
| * | ||
| */ | ||
| /** | ||
| * | ||
| */ | ||
| module com.espressif.idf.uploads | ||
| { | ||
| } |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
🛠️ Refactor suggestion
Robust File Existence Check with Opportunity for Enhanced Error Handling
The conditional check using
[ -f "$FILE" ]is correctly implemented to determine if the file exists before attempting an upload. The script logs an informative message if the file is not found.Suggestion: Consider capturing and evaluating the exit code of the
aws s3 cpcommand. This can help in detecting and reporting potential upload failures, ensuring that the CI process fails explicitly if the file upload is critical. For example:📝 Committable suggestion
🧰 Tools
🪛 YAMLlint (1.35.1)
[error] 39-39: no new line character at the end of file
(new-line-at-end-of-file)