Skip to content

Commit f17625c

Browse files
committed
add project name env var, even in the bundle_id
1 parent 424c3ab commit f17625c

File tree

1 file changed

+23
-20
lines changed

1 file changed

+23
-20
lines changed

.github/workflows/release.yml

Lines changed: 23 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@ on:
66
- "[0-9]+.[0-9]+.[0-9]+*"
77

88
env:
9+
# As defined by the Taskfile's PROJECT_NAME variable
10+
PROJECT_NAME: arduino-create-agent
911
TARGET: "/CreateAgent/Stable"
1012
OLD_TARGET: "/CreateBridge/" # compatibility with older releases (we can't change config.ini)
1113
VERSION_TARGET: "arduino-create-static/agent-metadata/"
@@ -122,11 +124,11 @@ jobs:
122124

123125
# this will create `public/` dir with compressed full bin (<version>/<os>-<arch>.gz) and a json file
124126
- name: Create autoupdate files
125-
run: go-selfupdate arduino-create-agent${{ matrix.ext }} ${TAG_VERSION}
127+
run: go-selfupdate ${{ env.PROJECT_NAME }}${{ matrix.ext }} ${TAG_VERSION}
126128
if: matrix.arch != '-386' && steps.prerelease.outputs.IS_PRE != 'true'
127129

128130
- name: Create autoupdate files for win32
129-
run: go-selfupdate -platform windows${{ matrix.arch }} arduino-create-agent${{ matrix.ext }} ${TAG_VERSION}
131+
run: go-selfupdate -platform windows${{ matrix.arch }} ${{ env.PROJECT_NAME }}${{ matrix.ext }} ${TAG_VERSION}
130132
if: matrix.arch == '-386' && matrix.os == 'windows-2019' && steps.prerelease.outputs.IS_PRE != 'true'
131133

132134
- name: Upload autoupdate files to Arduino downloads servers
@@ -139,9 +141,9 @@ jobs:
139141
- name: Upload artifacts
140142
uses: actions/upload-artifact@v3
141143
with:
142-
name: arduino-create-agent-${{ matrix.os }}${{ matrix.arch }}
144+
name: ${{ env.PROJECT_NAME }}-${{ matrix.os }}${{ matrix.arch }}
143145
path: |
144-
arduino-create-agent*
146+
${{ env.PROJECT_NAME }}*
145147
config.ini
146148
if-no-files-found: error
147149

@@ -159,8 +161,8 @@ jobs:
159161
- name: Download artifact
160162
uses: actions/download-artifact@v3
161163
with:
162-
name: arduino-create-agent-${{ matrix.os }}${{ matrix.arch }}
163-
path: arduino-create-agent
164+
name: ${{ env.PROJECT_NAME }}-${{ matrix.os }}${{ matrix.arch }}
165+
path: ${{ env.PROJECT_NAME }}
164166

165167
- name: Import Code-Signing Certificates
166168
run: |
@@ -180,32 +182,33 @@ jobs:
180182
# gon does not allow env variables in config file (https://github.com/mitchellh/gon/issues/20)
181183
run: |
182184
cat > gon.config.hcl <<EOF
183-
source = ["arduino-create-agent/arduino-create-agent"]
184-
bundle_id = "cc.arduino.arduino-agent"
185+
# See: https://github.com/mitchellh/gon#configuration-file
186+
source = ["${{ env.PROJECT_NAME }}/${{ env.PROJECT_NAME }}"]
187+
bundle_id = "cc.arduino.${{ env.PROJECT_NAME }}"
185188
sign {
186189
application_identity = "Developer ID Application: ARDUINO SA (7KT7ZWMCJT)"
187190
}
188191
# Ask Gon for zip output to force notarization process to take place.
189192
# The CI will ignore the zip output, using the signed binary only.
190193
zip {
191-
output_path = "arduino-create-agent.zip"
194+
output_path = "${{ env.PROJECT_NAME }}.zip"
192195
}
193196
EOF
194197
195198
- name: Code sign and notarize app
196199
run: |
197-
echo "gon will notarize executable in arduino-create-agent/arduino-create-agent"
200+
echo "gon will notarize executable in ${{ env.PROJECT_NAME }}/${{ env.PROJECT_NAME }}"
198201
gon -log-level=debug -log-json gon.config.hcl
199202
timeout-minutes: 30
200203

201204
# This step will overwrite the non signed mac artifact (arduino-create-agent-${{ env.RUNS_ON }})
202205
- name: Upload artifact
203206
uses: actions/upload-artifact@v3
204207
with:
205-
name: arduino-create-agent-${{ matrix.os }}${{ matrix.arch }}
208+
name: ${{ env.PROJECT_NAME }}-${{ matrix.os }}${{ matrix.arch }}
206209
path: |
207-
arduino-create-agent
208-
!arduino-create-agent.zip
210+
${{ env.PROJECT_NAME }}
211+
!${{ env.PROJECT_NAME }}.zip
209212
if-no-files-found: error
210213

211214
# This job is responsible for generating the installers (using installbuilder)
@@ -269,19 +272,19 @@ jobs:
269272
- name: Download artifact
270273
uses: actions/download-artifact@v3
271274
with:
272-
name: arduino-create-agent-${{ matrix.os }}${{ matrix.arch }}
275+
name: ${{ env.PROJECT_NAME }}-${{ matrix.os }}${{ matrix.arch }}
273276
path: ${{ matrix.executable-path }} # path expected by installbuilder
274277

275278
# zip artifacts do not mantain executable permission
276279
- name: Make executable
277-
run: chmod -v +x ${{ matrix.executable-path }}arduino-create-agent*
280+
run: chmod -v +x ${{ matrix.executable-path }}${{ env.PROJECT_NAME }}*
278281
if: matrix.os == 'ubuntu-20.04' || matrix.os == 'macos-12'
279282

280283
- name: Rename executable to Arduino_Create_Agent
281-
run: mv -v ${{ matrix.executable-path }}arduino-create-agent${{ matrix.extension }} ${{ matrix.executable-path }}Arduino_Create_Agent${{ matrix.extension }}
284+
run: mv -v ${{ matrix.executable-path }}${{ env.PROJECT_NAME }}${{ matrix.extension }} ${{ matrix.executable-path }}Arduino_Create_Agent${{ matrix.extension }}
282285

283286
- name: Rename executable to Arduino_Create_Agent_cli
284-
run: mv -v ${{ matrix.executable-path }}arduino-create-agent_cli${{ matrix.extension }} ${{ matrix.executable-path }}Arduino_Create_Agent_cli${{ matrix.extension }}
287+
run: mv -v ${{ matrix.executable-path }}${{ env.PROJECT_NAME }}_cli${{ matrix.extension }} ${{ matrix.executable-path }}Arduino_Create_Agent_cli${{ matrix.extension }}
285288
if: matrix.os == 'ubuntu-20.04'
286289

287290
- name: get year
@@ -390,7 +393,7 @@ jobs:
390393
run: |
391394
cat > gon.config_installer.hcl <<EOF
392395
source = ["ArduinoCreateAgent-osx/ArduinoCreateAgent-${GITHUB_REF##*/}-osx${{ matrix.arch }}-installer-${{ matrix.browser }}.app"]
393-
bundle_id = "cc.arduino.arduino-agent-installer"
396+
bundle_id = "cc.arduino.${{ env.PROJECT_NAME }}-installer"
394397
395398
sign {
396399
application_identity = "Developer ID Application: ARDUINO SA (7KT7ZWMCJT)"
@@ -458,8 +461,8 @@ jobs:
458461
update_release_body: false # `true` won't work because trigger type is not release
459462
files: |
460463
release/*.exe
461-
arduino-create-agent-windows-2019-386/arduino-create-agent.exe
462-
arduino-create-agent-windows-2019-amd64/arduino-create-agent.exe
464+
${{ env.PROJECT_NAME }}-windows-2019-386/${{ env.PROJECT_NAME }}.exe
465+
${{ env.PROJECT_NAME }}-windows-2019-amd64/${{ env.PROJECT_NAME }}.exe
463466
464467
- name: Create changelog
465468
uses: arduino/create-changelog@v1

0 commit comments

Comments
 (0)