Skip to content

Commit 5f9722c

Browse files
committed
x
1 parent 0083a29 commit 5f9722c

File tree

1 file changed

+15
-11
lines changed

1 file changed

+15
-11
lines changed

.github/workflows/build_esptool.yml

Lines changed: 15 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -40,12 +40,23 @@ jobs:
4040

4141
env:
4242
DISTPATH: esptool-${{ matrix.platform }}
43+
# Will be changed.
44+
ARCHIVE_NAME:
4345
STUBS_DIR: ./esptool/targets/stub_flasher/
4446
EFUSE_DIR: ./espefuse/efuse_defs/
4547
# Might be changed to allow signing on macOS.
4648
PYINSTALLER_FLAGS:
4749

4850
steps:
51+
- name: Setup
52+
shell: bash
53+
run: |
54+
if [[ "${{ runner.os }}" == "Windows" ]]; then
55+
echo ARCHIVE_NAME=esptool-${{ matrix.platform }}.zip >> $GITHUB_ENV
56+
else
57+
echo ARCHIVE_NAME=esptool-${{ matrix.platform }}.tar.gz >> $GITHUB_ENV
58+
fi
59+
4960
- name: Checkout repository
5061
uses: actions/checkout@v4
5162

@@ -139,31 +150,24 @@ jobs:
139150
if: runner.os != 'Windows'
140151
shell: bash
141152
run: |
142-
tar c -vzf "${{ env.DISTPATH }}.tar.gz" ${{ env.DISTPATH }}
143-
153+
tar c -vzf "${{ env.ARCHIVE_NAME }}" ${{ env.DISTPATH }}
144154
- name: Create archive for Windows
145155
if: runner.os == 'Windows'
146156
shell: bash
147157
run: |
148-
7z a -tzip ${{ env.DISTPATH }}.zip ${{ env.DISTPATH }}
158+
7z a -tzip ${{ env.ARCHIVE_NAME }} ${{ env.DISTPATH }}
149159
150160
- name: Archive artifact
151161
uses: actions/upload-artifact@v4
152162
with:
153163
name: ${{ env.DISTPATH }}
154-
path: ${{ env.DISTPATH }}.zip
164+
path: ${{ env.ARCHIVE_NAME }}
155165

156166
- name: Upload release
157167
if: github.event_name == 'release'
158168
uses: svenstaro/upload-release-action@v2
159169
with:
160170
repo_token: ${{ secrets.GITHUB_TOKEN }}
161-
file: ${{ env.DISTPATH }}.zip
171+
file: ${{ env.ARCHIVE_NAME }}
162172
tag: ${{ github.event.release.tag_name }}
163173
overwrite: true
164-
165-
- name: Archive artifact
166-
uses: actions/upload-artifact@v4
167-
with:
168-
name: ${{ env.DISTPATH }}
169-
path: ${{ env.DISTPATH }}

0 commit comments

Comments
 (0)