Skip to content

Commit c724474

Browse files
cmaglieumbynos
andauthored
Rework config.ini path handling (#761)
* remove `embedded_autoextract`, it has never been used * rework `config.ini` searching By default the config.ini should be searched in the same directory of the binary. If it's not found maybe could be in the parent of the binary, inside `Resources/` (we are on macos). Added also some logging. Use `go-paths-helper` to ease things. * fine-tune a config searching and parsing * enable `ARDUINO_CREATE_AGENT_CONFIG` env var to specify the config.ini * crashreports are now created in `.arduino-create/logs` to preserve macos bundle integrity * embed config file and change a bit the logic of searching * remove `config.ini` from the CI, now it's generated by the executable * Use more appropriate directory folders for config.ini * Moved config stuff in config.go --------- Co-authored-by: Umberto Baldi <[email protected]> Co-authored-by: umbynos <[email protected]>
1 parent db73ee7 commit c724474

File tree

6 files changed

+512
-76
lines changed

6 files changed

+512
-76
lines changed

.github/workflows/publish-go-tester-task.yml

-2
Original file line numberDiff line numberDiff line change
@@ -138,12 +138,10 @@ jobs:
138138
run: task go:build
139139
if: runner.os == 'macOS'
140140

141-
# config.ini is required by the executable when it's run
142141
- name: Upload artifacts
143142
uses: actions/upload-artifact@v3
144143
with:
145144
name: arduino-create-agent-${{ matrix.os }}${{ matrix.arch }}
146145
path: |
147146
arduino-create-agent*
148-
config.ini
149147
if-no-files-found: error

.github/workflows/release.yml

-6
Original file line numberDiff line numberDiff line change
@@ -131,14 +131,12 @@ jobs:
131131
aws s3 sync public/ s3://${{ secrets.DOWNLOADS_BUCKET }}${{ env.OLD_TARGET }}
132132
if: steps.prerelease.outputs.IS_PRE != 'true'
133133

134-
# config.ini is required by the executable when it's run
135134
- name: Upload artifacts
136135
uses: actions/upload-artifact@v3
137136
with:
138137
name: ${{ env.PROJECT_NAME }}-${{ matrix.os }}${{ matrix.arch }}
139138
path: |
140139
${{ env.PROJECT_NAME }}*
141-
config.ini
142140
if-no-files-found: error
143141

144142
create-macos-bundle:
@@ -164,10 +162,6 @@ jobs:
164162
- name: Remove placeholder file
165163
run: rm -rf ${{ env.EXE_PATH }}.empty
166164

167-
- name: Move config.ini to the Resources dir
168-
working-directory: ${{ env.EXE_PATH }}
169-
run: mv config.ini ../Resources/
170-
171165
# zip artifacts do not mantain executable permission
172166
- name: Make executable
173167
run: chmod -v +x ${{ env.EXE_PATH }}${{ env.PROJECT_NAME }}

0 commit comments

Comments
 (0)